Release mode (/MT vs /MTd)

Description: I’m trying to compile a JUCE application in release mode using the Multithreaded (/MT) runtime library option. However, I can only get it to compile in Multithreaded Debug (/MTd) mode (Microsoft Visual Studio 2022). Here are the details:

  1. Projucer Configuration:
  • In Projucer, I’ve set the “Runtime Library” option to “Use static runtime,” but it defaults to Multithreaded Debug (/MTd) with the DEBUG flag.
  • Is there a way to force it to use NDEBUG and /MT for release builds?
  1. Preprocessor Definitions:
  • I’ve checked for any specific Debug-related preprocessor definitions (like DEBUG) in my code or project settings.
  • Are there any other flags related to Preprocessor Definitions that I should consider?
  1. Other Dependencies:
  • I’m using other libraries alongside JUCE. Could they be affecting the runtime library selection?
  • How can I ensure that my application links correctly to the appropriate runtime library?

Any insights or suggestions would be greatly appreciated! Thank you! :blush:

When I check my projects I see that I have static runtime selected in Projucer for both Debug and Release build configs. When I check the Debug and Release modes in VS, they show correcly as /MTd and /MT.

I think this should work out of the box without special tweaks.

If you switch to Release in VS and open the section “C/C++ code generation”, what is displayed in the line “Runtime library”?

Peter, thank you very much for your response. This has helped me identify the source of the issue. My apologies for raising such a trivial problem!!! I simply needed to select the ‘Debug mode’ field in Projucer with the value ‘Disabled’ for the Release mode. It’s working now!! :wink:

Top!