Rectangle clash with windows.h [solved]


Hello I have an odd problem where I have a really tiny 3rd party library I want to try but unfortunately they include windows.h (lean_and_mean) which creates hundreds of errors in my Juce code starting with

'Rectangle': ambiguous symbol (compiling source file ..\..\Source\PluginEditor.cpp)
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\wingdi.h(4515):
 note: could be 'BOOL Rectangle(HDC,int,int,int,int)' (compiling source file ..\..\Source\PluginEditor.cpp)1>e:\plug-ins\juce\modules\juce_graphics\geometry\juce_rectangle.h(40):
note: or       'juce::Rectangle' (compiling source file ..\..\Source\PluginEditor.cpp)

Which is a clash with Juce’s Rectangle and Window’s. Is there a neat way around this please? Sorry if it’s a bit newbie! :slight_smile:


Never mind, I found on this site that I can add

#define NOGDI 
  #include <windows.h>

To the new include AND NOT do a LEAN_AND_MEAN for the whole plug-in as the VST wrapper code has a load of ‘htonl’ missing errors if I do.
Thanks anyway. :smiley: