Windows.h error

I get an error:

WINDOWS.H already included. MFC apps must not #include <windows.h> 

Help needed.

+4
source share
6 answers

Remove the second inclusion from (presumably) your code. Here is the MSDN forum question about the issue, it looks like it may also depend on your exact order of inclusion.

+3
source

Using the /showIncludes directive of the preprocessor, all incoming data will be displayed in the output window before the error. There you can find which file mistakenly includes windows.h .

Then find out why this file is needed.

+3
source

If you use MFC, do not use #include <windows.h> manually anywhere in your code. MFC includes it in its own way, and you already have access to all the ads in this headline.

+3
source

Well, the error message seems just to everyone.

When you created the MFC application, it already included windows.h.

+2
source

Sometimes the best way to fix errors is to do as the error message says.

Just a thought.

+1
source

Use #include <afx.h> instead of #include <windows> when working with mfc.

-one
source

All Articles