tags:

views:

588

answers:

2

Hi

I am getting #error WINDOWS.H already included. MFC apps must not #include windows.h But i dont know how do i find out because of which file this is happening

Thanks

A: 

First, see what translation unit (cpp file) was compiled when the error occured (see build log).

Then... you could either inspect the header files included by that cpp file, looking for <windows.h>.

You could also search in all project files for to check whether it is included from your code.

If you're using other 3rd party libraries that include windows.h header, then you might be forced to change the order of inclusion of those header files and MFC headers.

Cătălin Pitiș
+4  A: 

Try turning on "Show Includes" in the projects settings (C/C++ -> Advanced). This show give you an indication of what header files are included and in what order - you should be able to trace back from there

Alan