My project uses Eigen-3.3-beta. I can build my project in visual studio 2015 community which includes <Eigen/Core>. But after I include <unsupported\Eigen\CXX11\Tensor>, I got strange compile errors like these:
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46): error C3646: 'nLength': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(46): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(47): error C3646: 'lpSecurityDescriptor': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(47): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(48): error C3646: 'bInheritHandle': unknown override specifier
......
1>C:\Program Files (x86)\Windows Kits\8.1\Include\um\minwinbase.h(295): fatal error C1003: error count exceeds 100; stopping compilation
It seems that my project works properly with Eigen-3.3-beta's normal part except unsupported module. What's more, with unsupported module included, types introduced by GLEW (e.g. GLfloat) cannot be resolved. Did I do something wrong?
It seems this stems from the include of in <unsupported\Eigen\CXX11\Tensor>.
I solved it with help from this thread (Compile error in 'winbase.h' ) and just exchanged line 38 in <unsupported\Eigen\CXX11\Tensor> from #include <winbase.h> with #include <windows.h>.
Edit: This seems to be the way it was fixed in the lasted version in the repository.
Related
I'm building a program on Visual Studio 2017 and I need Winbase.h in order to write INI files. However when I try to debug the program I'm getting a bunch of errors related to Winbase.h, even though I haven't changed anything in that file.
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(47): error C3646: 'nLength': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(47): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(48): error C3646: 'lpSecurityDescriptor': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(48): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(49): error C3646: 'bInheritHandle': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(49): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(53): error C3646: 'Internal': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(53): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(54): error C3646: 'InternalHigh': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\minwinbase.h(54): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Looking at minwinbase.h itself my best guess is that it's code for 32-bit windows and I'm using 64-bit. If I'm right, is there any alternative to using winbase.h for 64-bit platforms?
I created a C++ Windows DLL Project in Visual Studio 2017. Following is the code which I have wrote, nothing much but importing the header files so far now.
#include "stdafx.h"
#include "windows.h"
#include "ntdsapi.h"
#include "activeds.h"
#pragma comment(lib, "ntdsapi.lib")
#pragma comment(lib, "activeds.lib")
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
When I tried to compile, I get a lot of errors in the ntdsapi.h and activeds.h headers. But this seems to work fine when I used the same headers in the Windows C++ Console Project.
I need to make use of Active Directory functions defined in ntdsapi.h and activeds.h headers.
Following is the error list:
1>dllmain.cpp
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(924): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(934): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(960): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(971): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(996): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1008): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1036): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1050): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1148): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1159): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1172): error C2065: 'RPC_AUTH_IDENTITY_HANDLE': undeclared identifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1173): error C2146: syntax error: missing ')' before identifier 'AuthIdentity'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1531): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1531): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1542): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1542): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1724): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1724): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1740): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1740): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1794): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1794): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1806): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(1806): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2611): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2611): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2621): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2621): error C2143: syntax error: missing ',' before '*'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2707): error C3646: 'uuidNamingContextObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2707): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2708): error C3646: 'uuidSourceDsaObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2708): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2709): error C3646: 'uuidSourceDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2709): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2710): error C3646: 'uuidAsyncIntersiteTransportObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2710): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2731): error C3646: 'uuidNamingContextObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2731): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2732): error C3646: 'uuidSourceDsaObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2732): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2733): error C3646: 'uuidSourceDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2733): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2734): error C3646: 'uuidAsyncIntersiteTransportObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2734): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2757): error C3646: 'uuidSourceDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2757): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2762): error C3646: 'uuidSourceDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2762): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2768): error C3646: 'uuidSourceDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2768): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2776): error C3646: 'uuidSourceDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2776): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2818): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2818): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2827): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2827): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2838): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2838): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2866): error C3646: 'uuidDsaObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2866): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2875): error C3646: 'uuidDsaObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2875): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2912): error C3646: 'uuidNamingContextObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2912): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2913): error C3646: 'uuidDsaObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2913): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2930): error C3646: 'uuidNamingContextObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2930): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2931): error C3646: 'uuidDsaObjGuid': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2931): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2957): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2957): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2975): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2975): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2994): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(2994): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3013): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3013): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3029): error C3646: 'uuidLastOriginatingDsaInvocationID': unknown override specifier
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3029): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3091): error C2061: syntax error: identifier 'UUID'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3103): error C2061: syntax error: identifier 'UUID'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3143): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\ntdsapi.h(3157): error C2061: syntax error: identifier 'RPC_AUTH_IDENTITY_HANDLE'
1>Done building project "AdDll.vcxproj" -- FAILED.
By default, the Dll projects adds this define to the stdafx.h.
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows
Remove this line and rebuild.
More info about the lean and mean.
https://blogs.msdn.microsoft.com/oldnewthing/20091130-00/?p=15863
There is a triangular mesh generator (Shewchuk, CMU), "Triangle", that are recommended by people due to its lightweight. It is written in C. However I cannot use it in my VS2012 C++ project. I am compiling it using x64 platform. I am on Windows 7 64-bit.
Basically, I compile the triangle.c as the makefile described. So, a triangle.o is generated. I then
added triangle.o as additional dependencies in my solution,
added triangle.c and triangle.h in my project .
changed triangle.c in C/C++ precompiled header option, to "not using precompiled header"
Then I got tons of errors like this:
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(430): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(430): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(497): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(497): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(498): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(498): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(2517): warning C4391: 'SHORT _InterlockedIncrement16(volatile SHORT *)' : incorrect return type for intrinsic function, expected 'short'
I am just wondering, is there anyway to make the triangular mesh generator work with VS2012 C++ project? If so, what is the right way to set it up on VS2012 C++ x64?
You might want to have a look at this: Compilation errors of a simple C++ project in VS 2012.RC 4
disable pre-compiled headers, and delete the pch file from the intermediate directory.
This initially didn't work for me, so I tried moving #include at the top of the file, before all other includes, and this worked for me.
I am doing a small personal project involving printing out info about a PE file.
I have read that most of the pe structure is already defined in winnt.h header.
Upon including the winnt.h, and compiling the project i get the following error:
#error : "No Target Architecture"
I tried putting a define x86, it might have fixed the architecture problem, but there are even more compilation problems.
For example:
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(363): error C2146: syntax error : missing ';' before identifier 'WCHAR'
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(363): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(367): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(367): error C2040: 'PWSTR' : 'CONST' differs in levels of indirection from 'WCHAR *'
check Compiler->Enable Microsoft extensions in Project options or use -Ze flag if you're compiling from the command line.
I've recently got the source-code on a application. When im trying to build the solution, I get an error in all parts where winnt.h is included. The error codes differs a bit, but they always point to these lines in winnt.h:
typedef void *PVOID;
typedef void * POINTER_64 PVOID64;
and
struct {
DWORD crc;
BYTE rgbReserved[14];
} CRC;
So, what could be the cause of this? winnt.h is a standard header and has not been modified. Does it has something to do with me using VS 2010, or me using 64-bit windows? or is it some sort of configuration which is needed?
EDIT:
Here's the exact error-codes:
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(290): error C2146: syntax error : missing ';' before identifier 'PVOID64'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(290): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(8992): error C2146: syntax error : missing ';' before identifier 'Buffer'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(8992): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(8992): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(11525): error C2059: syntax error : 'constant'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(11525): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(11556): error C2059: syntax error : 'constant'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(11556): error C2238: unexpected token(s) preceding ';'
You need to include windows.h rather than winnt.h. When you include windows.h it will, in turn, include winnt.h. You need to do it this way for the necessary macros to be in place that are needed to compile winnt.h.
In this case, POINTER_64 is defined in BaseTsd.h like this:
#define POINTER_64 __ptr64
But if you include winnt.h before including windows.h then POINTER_64 is not defined.
If you are using DirectX SDK, try changing the VC++ Directories for include and lib to be searched last.
It looks like your configuration of the Windows SDK is invalid.
This error is caused by the fact that the compiler is unable to recognize the 'POINTER_64' statement.
You may workaround this problem by replacing 'POINTER_64' with '__ptr64'.
I had the same issue recently. Then I've reinstalled the latest version of the Windows SDK and this fixed the problem.
UPDATE
#David Heffernan, correctly points to the fact that one should include windows.h instead of winnt.h
Try to remove DirectX SDK if you have one.
Here bug is accepted:
http://connect.microsoft.com/VisualStudio/feedback/details/508204/vc10-0-errors-while-compiling-winnt-h
Corrected manually syntax in winnt.h :
typedef void * POINTER_64 PVOID64; => typedef void * POINTER_64, * PVOID64;
If you are using librdkafka, you will get this error whenever "Windows.h" included.
I fixed it by rename "librdkafka/include/basetsd.h" to a different name, or access
this library header via sub path!
I think the author of this library made this file to deal with OS platform compatibility. But with the same file name "basetsd.h" as Windows Core, it just confusing Visual Studio.