-
Notifications
You must be signed in to change notification settings - Fork 78
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
rust() and rust_mut() fails linking with MinGW gcc #397
Comments
Are you using CMake or building only with Cargo? GNU ld.bfd fails to link the qml-minimal-no-cmake example: #223 |
Can you try running |
We haven't been testing with MinGW, though maybe we should add that to CI... |
I'm using CMake 3.19 for build. All examples works, but when I add rust() or rust_mut(), this error happens. |
Maybe there is another way to get access to rust object? |
This seems odd how using rust/rust_mut causes the CxxQtThread queue stuff to have linker issues. We need to setup a MinGW environment to reproduce this and it would be good to have CI for that too. For now does using MSVC work for you on Windows ? or is that not available for you ? |
MSVC is not installed on my workstation yet, but I will do it soon |
It looks like the problem is not in rust_mut(). the problem disappears when I remove the use of the qinvokable function in c++ code. Code with any functions compiles successfully as long as I don't use them in c++ code. With all this, using clang/macos and the same code, I can use all the functions without any problems |
Can you link to your whole code repository? |
this is a commercial project, so I can't, unfortunately. I will try to make a minimal working project to reproduce the problem |
I seem to have found the reason. It was necessary to add the line Qt::Qml to target_link_libraries, it is very strange that it depends on the platform and compiler, and i havent qml components in rust part. |
Yeah there can be some weird stuff with dependencies between Qt libraries. For example, on macOS, we have to link QtNetwork when QtQml is linked 🤷
|
My code:
Output:
It's working good with macos/clang with same code, but fails on windows/gcc.
What could be the reason?
The text was updated successfully, but these errors were encountered: