Windows.h error
I a开发者_Python百科m getting error :
WINDOWS.H already included. MFC apps must not #include <windows.h>
Help needed.
Remove the second inclusion, from (presumably) your code. Here is a MSDN forum thread about the problem, it seems it can also depend on your exact inclusion order.
Using the /showIncludes
preprocessor directive, the output window will display all the includes before the error. There you can find which file erroneously includes windows.h
.
Then find out why this file is needed.
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 do all declarations of this header.
Oh well, the error message seems say just everything.
When you've created an MFC app, it already included windows.h.
Sometimes, the best way to fix errors is to do as the error message says.
Just a thought.
Use #include <afx.h>
instead of #include <windows>
when working with mfc.
精彩评论