NOMINMAX problem

I have a problem with std::max() being redefined on windows,

in main.cpp I added NOMINMAX, but it doesnt protect std::max().
What am I doing wrong?

#define NOMINMAX
#include "../JuceLibraryCode/JuceHeader.h"
// rest of app...

Have you maybe included some other header from another library that is including Windows.h? or have you possibly included Windows.h yourself? by default JUCE won’t include Windows.h in the header, and when it does it sets NOMINMAX before doing so.

1 Like

no, I do include neural amp modeler lib lateron in the code, rest is standard JUCE.. bit of a mystery

Sometimes it can be helpful to debug include related issues by enabling “Show Includes” in the Advanced section of the C/C++ options in the Project Properties. This will display all includes, as they are included, in the build window.

1 Like