Checked build builds libraries with MT runtime, even though NV_USE_DEBUG_WINCRT is set to True in CMake preset #78
-
Hi, I'm new to C++ so I apologize if I'm not understanding something. I just spent a good amount of time getting my application to compile with Physx libraries. I built them with the checked build configuration as was recommended in the documentation.
When inspecting the properties of the generated Physx projects in Visual studio I found that they are actually being built with MT instead. Only when I choose the debug build configuration does it output MTd lib files, and then with them my application compiles. So I am confused as to what the CMake preset file even does, because it seems like it's the build configuration presets that affect which CRT is used, and not the CMake preset. And I ran generate_projects.bat every time after making changes to the CMake preset. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @thfProjects, So "MTd" specify the runtime library that is used when building in Debug mode. That's what the "d" stands for. The MTd runtime library includes additional functionalities that can help with debugging (extra error checking and runtime assertions) but will significantly increase the size and performance, which make sense for debug and not for release. In your case, wouldn't be possible to build your application using MT in release and MTd in debug? Thanks |
Beta Was this translation helpful? Give feedback.
Hello @thfProjects,
So "MTd" specify the runtime library that is used when building in Debug mode. That's what the "d" stands for.
What you did to set the MTd runtime is actually correct, however, again, it's used only for Debug mode and you can see that clearly in https://github.com/NVIDIA-Omniverse/PhysX/blob/release/104.1/physx/source/compiler/cmake/windows/CMakeLists.txt#L48.
The MTd runtime library includes additional functionalities that can help with debugging (extra error checking and runtime assertions) but will significantly increase the size and performance, which make sense for debug and not for release. In your case, wouldn't be possible to build your application using MT in …