title: Discovering what define in windows.h is creating syntax errors
body: <p>I started working on the GUI aspect of a C++ application in Visual Studio 2015, after including <code>&lt;windows.h&gt;</code> I got extremely cryptic errors with other files having syntax problems. I discovered that including that header file was the source of the issues.</p>
  
  <p>I looked around online and found out about <code>NOMINMAX</code> but defining that didn't resolve the problem. I was using <code>numeric_limits&lt;int&gt;::min()</code>/<code>max()</code>, and one for <code>::infinity()</code> with floats, so <code>NOMINMAX</code> will solve that minor issue, but didn't solve the major issue of these syntax errors occurring as the min/max problem compiler errors were pretty specific.</p>
  
  <p>Moving the header to the very bottom seems to have solved it temporarily, <em>however I am not happy with this at all</em> because it means I have a potential timebomb in my code and I'm not sure where. Right now its 5k LOC but I'd rather deal with it know than get to 50k and run into this issue in a way that forces me to deal with it.</p>
  
  <p>What techniques do I have of finding out where the error is occurring? Can I possibly dump the files after pre-processing? Going through and commenting everything out would be particularly painful... but I don't know if I have a choice. I have a general idea of the location but its occurring sadly on very prominent set of includes, so the amount of commenting needed to attempt to isolate this isn't too pleasant.</p>
  
  <p>Is there a tool or some method to aid me in this problem? Or am I stuck having to do it the long and dirty way?</p>
  
  <p>NOTE: I have also tried <code>WIN32_LEAN_AND_MEAN</code>, <code>NOMINMAX</code>, and <code>VC_EXTRALEAN</code> in attempts to solve this but that does not work.</p>
  
  <p>EDIT: I have tried commenting/trying to find out what is causing it from the indicated lines but there are so many files/LOC that the resulting mess (due to this unfortunately occurring on frequently used files) means that the amount of work in tracking this down quickly became a nightmare, and thus I'm posting here looking for any heuristics on how I could identify this problem. It also compiles fine and uses all the functions where these syntax errors are occurring when I don't include the header file, so the code itself cannot be broken since the applications literally uses them and runs great.</p>