You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/src/getting-started/5-cmake-integration.md
+9-2
Original file line number
Diff line number
Diff line change
@@ -207,6 +207,13 @@ You should now see the two Labels that display the state of our `MyObject`, as w
207
207
208
208
### Windows with MSVC
209
209
210
-
If you're building CXX-Qt on Windows using MSVC generator, you need to ensure that `set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")` is set in CMake (or use the `-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL` flag) when building with the `Debug` configuration. This flag is necessary to ensure that the correct C Runtime Library is used. Then you can build using `cmake --build build --config Debug`.
210
+
With MSVC, all parts of the build need to agree on the runtime that is linked into the executable.
211
211
212
-
This issue is caused by a bug in the [cc](https://docs.rs/cc/latest/cc/index.html) crate (as described in [this pull request](https://github.com/rust-lang/cc-rs/pull/717)), which has not been merged yet. Specifically, the problem is that cc generated code always links to the MultiThreaded runtime, even when building in Debug mode. We hope that this step won't be necessary in the future, once the cc crate fix is merged and released.
212
+
As of CXX-Qt 0.7.2, cxx-qt-cmake will automatically set the right linker flags in the debug configuration.
213
+
214
+
The previous workaround of setting the CMAKE_MSVC_RUNTIME_LIBRARY to "MultiThreadedDLL" is no longer necessary or recommended!
0 commit comments