Undefined Symbols at Runtime #576
Unanswered
Christian-Prather
asked this question in
Q&A
Replies: 2 comments 9 replies
-
To clarify, you are using cxx build from build.rs buildscripts and not the function that corrosion provides for generating bindings with cxx, right? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Do you also get the error if you remove the "prefer-dynamic" option? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue
Hello again,
After working through all of my build issues I was finally able to get a successful rust workspace build using Corrosion! However upon trying to run some of my rust bins I was greeted with symbol lookup errors such as what you see below.
This stumped me and for the last day I have been messing with any possible combination of linker / settings I could think but nothing seems to work. I am wondering if anyone has seen this and if anyone working on Corrosion has any gut feel about this issue. I'm SO close to a working build I really want to get across that finish line!
Situation
Essentially I am using Corrosion not to add rust code to C++ but to support building rust code in a larger cmake based system.
I have a cmake file for a project called test-rust and in this cmake I am importing a workspace cargo.toml with Corrosion. This workspace consists of binaries I am trying to build and some dylib dependencies for said bins.
Currently the Cmake compilers for C/C++ are using GNU and are the drivers for the rustc linker (since I am NOT setting NO_LINKER_OVERRIDE) however I am passing
-fuse-ld=lld
to rust through a cargo config.toml file. Without this the cxx_build I have in some of my build.rs files fails to link.If I turn on NO_LINKER_OVERRIDE I get a full build same as without and the same error
Summary
I am using Corrosion to integrate the building of Rust bins and libs into a much larger legacy Cmake system. I have a rust workspace and while everything is building and linking at run time all of the (~20) bins have symbol lookup errors.
Again I want to make clear this is all building but at run time it fails.
Code Snippets
test-rust/CMakeLists.txt
test-rust/.cargo/config.toml
Thank you in advance for any input, advice, or guidance!
Beta Was this translation helpful? Give feedback.
All reactions