-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker error when trying to include more than one Rust bridge #956
Comments
After instrumenting
Is this intentional behavior with cxx-qt? Is there a way I can fix it to generate separate files? |
Since the file is named after the module ( |
Yup, until rust-lang/rust#54725 is stabilised we cannot replicate the CXX behaviour, see the ancient WIP branch here #200 and issue here #855 Until that happens I was going to make |
Repro repository here: https://github.com/akiselev/linker-repro
I am trying to bind several QWidgets classes but I'm getting undefined reference/symbol errors when trying to build more than one Rust file with CxxQt bindings.
For the above repro repository, this is the order in
build.rs
This is the error (I have tried with lld and mold):
If I change the order of the
builder.file
calls inbuild.rs
:It finds the QMainWindow symbols but instead fails to find the QWindow symbols:
Whichever Rust file is last is the one that gets linked in, the rest get ignored. If I use this order in build.rs:
and remove QMainWindow from main.rs altogether:
It builds and shows a window when run.
Does anyone have any idea why this is happening?
The text was updated successfully, but these errors were encountered: