When I try to compile my c++ project using Visual Studio 2010 in either Win32 or x64 mode I get the following error:
>C:\\Program Files (x86)\\Microsoft SDK
It would seem that _AMD64_
is not defined, since I can't imagine you are compiling for Itanium (_IA64_
).
If you are building 32bit then make sure you don't have _WIN64 defined for your project.
Another cause of this can be including a header that depends on windows.h
, before including windows.h
.
In my case I included xinput.h
before windows.h
and got this error. Swapping the order solved the problem.
Besides causes described already, I received this error because I'd include:
#include <fileapi.h>
Apparently it was not needed (despite of CreateDirectoryW call). After commenting out, compiler was happy. Very strange.
Use #include <windows.h>
instead of #include <windef.h>
.
From the windows.h wikipedia page:
There are a number of child header files that are automatically included with
windows.h
. Many of these files cannot simply be included by themselves (they are not self-contained), because of dependencies.
windef.h
is one of the files automatically included with windows.h
.