Closed EMCP closed 12 months ago
For me, the solution was the following:
1) Make sure your building static instead of shared libs
# in conanfile.txt
[options]
your_lib:shared=False
2) cargo_emit()
will result in cargo:rustc-link-lib=your_lib
, which does not take into account that you built a static lib (this looks like a bug to me)
To fix this, you need to manually print the correct line:
// in build.rs
println!("cargo:rustc-link-lib=static=your_lib");
thank you @tom-anders for the static option tip.. I have added that.. I have paired back the project to just see if I can get it to build with a hello world CXX now.. full post is in discourse https://users.rust-lang.org/t/cxx-noob-with-simple-hello-world-not-finding-my-library-function/100957
I think I can close this ticket until that more basic issue is resolved now.. but I think your tip has helped
I just wanted to checkin if I am doing something wrong with my conan package.. I have updated my recipe to call out the system library dependency.. but CXX still cannot find my libraries built.. everything works in C++ just fine so I am a bit lost
https://github.com/dtolnay/cxx/issues/1132#issuecomment-1328020950
the conanmanifest.txt
I added the system library dep like so
https://stackoverflow.com/a/74475762/389976
but seems CXX just cannot find what C++ 's GCC normally can via regular conan
Any thoughts? if it's clearly not a conanRS issue feel free to close, thanks for looking