SUMMARY When using cargo for compilation, such as with the "qt_quick_cargo" template, if the C++ library is already compiled, then rust-qt-bindings-generator will output linker information, including the standard library stdc++. When compiling with stdc++, this fails because stdc++.lib does not exist. The relevant code is here: https://github.com/KDE/rust-qt-binding-generator/blob/master/src/build.rs#L241 rust-qt-bindings-generator should replicate the behavior of the cc crate, which can be found here: https://github.com/alexcrichton/cc-rs/blob/master/src/lib.rs#L928 STEPS TO REPRODUCE 1. Compile the qt_quick_cargo template 2. Change main.rs to trigger a recompile of the rust code but not the C++ library 3. Recompile OBSERVED RESULT MSVC fails to link stdc++ EXPECTED RESULT It should not try to link to stdc++ SOFTWARE VERSIONS commit ed2de054928db6f02a13c97afee789b1de1eebcd ADDITIONAL INFORMATION
Git commit 89c86642f8e39c1906da72333b431e72ba8dc268 by Jos van den Oever. Committed on 28/10/2018 at 21:05. Pushed by vandenoever into branch 'master'. Print the c++ library that cargo should link against This is used when calling "cargo build" when no actual recompile is needed. M +19 -1 src/build.rs https://commits.kde.org/rust-qt-binding-generator/89c86642f8e39c1906da72333b431e72ba8dc268
Thank you for the bug report and pointer. Commit 89c86642f8e39c1906da72333b431e72ba8dc268 should fix it.
rust-qt-binding-generator is no longer maintained, please try more recent alternatives like https://github.com/KDAB/cxx-qt/