"Some extern functions couldn't be found; some native libraries may need to be installed or have their path specified"
Help with cargo build and Rust bindgen and custom C/C++ library, on Ubuntu Linux. Native libraries are mpfr, gmp, gmpxx. For purposes of this example, external code has been reduced to two functions, add_long(long i, long j) and add_double(double i, double j).
Note, the generated bindings.rs uses link_name with \u{1} whereas on GitHub the extern C code uses link(name="library_name"). Neither option appears to work!
For the problematic project, on Ubuntu the Cpp compiler is optional since the .so file is available on GitHub. Here are the tool versions I'm using:
rustc 1.87.0
g++ 14.2.0
The problem appears to be related to C++? Without the Cpp compiler/linker flags the bindings will generate fine for C code. Adding the following to Rust-Bindgen-Example build.rs, will cause the same error message, regarding native libraries.
.clang_arg("-xc++")
.clang_arg("-std=c++11")