#include <windows.h> causes a lot of syntax errors - c++

My program uses Qt and OpenGL. It compiles correctly under Linux and Mac.
When compiled on windows, I need to #include windows.h in order to use OpenGL, the code is like following,
#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
#include <windows.h>
#endif
#ifdef __APPLE__
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/glu.h>
#include <GL/glut.h>
#endif
However, there are a lot of error messages like
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2146: syntax error : missing ')' before identifier 'PRPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2513: 'void *' : no variable declared before '='
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2440: 'initializing' : cannot convert from 'std::ostream' to 'void *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(168) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(226) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(226) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(226) : error C2491: 'I_RpcNegotiateTransferSyntax' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(227) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(235) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(235) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(235) : error C2491: 'I_RpcGetBuffer' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(236) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(242) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(242) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(242) : error C2491: 'I_RpcGetBufferWithObject' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(244) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(251) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(251) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(251) : error C2491: 'I_RpcSendReceive' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(252) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(259) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(259) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(259) : error C2491: 'I_RpcFreeBuffer' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(260) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(267) : error C2146: syntax error : missing ')' before identifier 'PRPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(267) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(267) : error C2491: 'I_RpcSend' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(268) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(275) : error C2146: syntax error : missing ')' before identifier 'PRPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(275) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(275) : error C2491: 'I_RpcReceive' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(277) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(284) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(284) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(284) : error C2491: 'I_RpcFreePipeBuffer' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(285) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : error C2146: syntax error : missing ')' before identifier 'I_RPC_MUTEX'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : error C2182: 'I_RpcRequestMutex' : illegal use of type 'void'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : error C2491: 'I_RpcRequestMutex' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(303) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(438) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(453) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(479) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(487) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(534) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(542) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(728) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(744) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(754) : error C2146: syntax error : missing ')' before identifier 'UUID'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(754) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(754) : error C2491: 'I_UuidCreate' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(755) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(763) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(771) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(779) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(838) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(848) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(873) : error C2144: syntax error : 'unsigned long' should be preceded by ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(873) : error C2448: 'I_RpcConnectionInqSockBuffSize' : function-style initializer appears to be a function definition
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(874) : error C2144: syntax error : 'unsigned long' should be preceded by ';'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(874) : fatal error C1903: unable to recover from previous error(s); stopping compilation
If I don't #include windows.h, then those errors will not appear.
I am using VS2013 with Qt 5.3.

OpenGL on Microsoft Windows is tied to WGL, which is in turn tied to GDI.
As a result, you cannot #include <gl/gl.h> (you are indirectly doing this by including <GL/glu.h>) without first including some Windows-specific header that defines GDI/Windows pre-processor tokens such as WINGDIAPI and APIENTRY. But that is actually the extent to which any OpenGL program on Windows is tied to anything Windows-specific (header wise).
WinDef.h defines APIENTRY and WinGDI.h defines WINGDIAPI - including Windows.h brings in both of those headers (and a lot of other garbage unfortunately). So including Windows.h is mostly a convenience; to minimally compile OpenGL software on Windows you should #include <WinDef.h> followed by #include <WinGDI.h> and then finally #include <GL/gl.h>.
Alternatively, you can #define WIN32_LEAN_AND_MEAN just prior to #include <Windows.h> and it will significantly reduce the number of unrelated things that are brought in by including that header. Many Visual C++ projects actually define that pre-processor definition by default when they are first created, you might want to see if your project is configured that way.

windows.h clutter the global namespace with tons of bad things like ERROR, Rectangle ...
One way around the problem is to declare needed functions your self (I guess this is not too mutch work since you will not need more than 10 functions or so). You can call the include file wgl.h or something.
__declspec(dllimport) void* __stdcall wglCreateContext(void* hdc);
//... Other functions you need
The OpenGL API is defined outside windows.h so no problem there

Related

ATL complains about not including Windows after VS2012 -> VS2017

I'm currently update our projects from VS2012 to VS2017. This has led one project to crash and moan in compilation about ATL.
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2143: syntax error: missing ')' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2143: syntax error: missing ';' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2059: syntax error: '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(450): error C2059: syntax error: ')'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2065: 'PFNMOVEFILETRANSACTED': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2146: syntax error: missing ';' before identifier 'pfMoveFileTransacted'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2065: 'pfMoveFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(451): error C2146: syntax error: missing ';' before identifier 'GetProcAddress'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(453): error C2065: 'pfMoveFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(455): error C2065: 'pfMoveFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2143: syntax error: missing ')' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2143: syntax error: missing ';' before '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2059: syntax error: '__stdcall'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(571): error C2059: syntax error: ')'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2065: 'PFNFINDFIRSTFILETRANSACTED': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2146: syntax error: missing ';' before identifier 'pfFindFirstFileTransacted'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2065: 'pfFindFirstFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(572): error C2146: syntax error: missing ';' before identifier 'GetProcAddress'
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(574): error C2065: 'pfFindFirstFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(576): error C2065: 'pfFindFirstFileTransacted': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(576): error C2065: 'FindExInfoStandard': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atltransactionmanager.h(576): error C2065: 'FindExSearchNameMatch': undeclared identifier
1>c:\program files (x86)\microsoft visual studio\2017\professional\vc\tools\msvc\14.16.27023\atlmfc\include\atlcom.h(175): error C2065: 'COINIT_MULTITHREADED': undeclared identifier
1>Done building project "MyProj.vcxproj" -- FAILED.
With error lines such as "undeclared identifier" refers to headers in the windows.h library.
When I include I include through a StdAfx.h which has;
#include <atlbase.h>
#include <atlcom.h>
Regardless where I put Windows.h, the error occurs. I find it likely that it is generated by _WIN32_WINNTstuff but all of that "should" work. Is it deprecated? I don't know... Anyone have any ideas?
In my case there were multiple project including each others stdafx.h headers. This caused the macros to fail/corrupt. Sorting that out and using correct values of WINVER and _WIN32_WINNT fixed it all.
Aside from Alexander's answer make sure that you do NOT define the following:
#define NOTEXTMETRIC

Get massive compile error whenever windows.h is included, my environment is visual studio 2013 in win 7

I have a CPP file Log.cpp which has one line code:
#include "windows.h"
When I compile it, massive syntax errors display:
1>------ Build started: Project: topx, Configuration: Debug Win32 ------
1> Log.cpp
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(936): error C2065: 'hMem' : undeclared identifier
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(936): error C2065: 'dwBytes' : undeclared identifier
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(938): 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\winbase.h(938): error C2491: '_Ret_reallocated_bytes_' : definition of dllimport data not allowed
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(938): error C2078: too many initializers
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(938): error C2146: syntax error : missing ';' before identifier 'HGLOBAL'
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(938): error C2143: syntax error : missing ';' before '__stdcall'
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(938): error C2377: 'HGLOBAL' : redefinition; typedef cannot be overloaded with any other symbol
1> c:\program files (x86)\windows kits\8.0\include\shared\minwindef.h(211) : see declaration of 'HGLOBAL'
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(940): error C2146: syntax error : missing ')' before identifier 'hMem'
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(940): warning C4229: anachronism used : modifiers on data are ignored
1>c:\program files (x86)\windows kits\8.1\include\um\winbase.h(940): 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\winbase.h(943): error C2059: syntax error : ')'
....
....
But all is OK when I compile it under windows 8, what is the problem?
Change from:
C:\Program Files (x86)\Windows Kits\8.0\Include\shared
to
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
in "Additional include directories" of project resolve this problem, but I do not know why.

Compilation errors of a simple C++ project in VS 2012.RC 4

I had a program I could run before upgrading to VS 2012.3 and VS 2012.rc4 (VS ultimate 2012 version 11.0.60930.00 update 4 RC). But It shows some strange errors in some include files after upgrade. Specially, the problem is about the "windows.h" header file. I cannot even compile a simple program, as below. I have also changed the order of include files, but the errors remain. I hope you can help me.
EDIT:
When I change the platform toolset from v11 to v10, the errors disappear and I can compile them correctly.
#include "stdafx.h"
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
Errors:
1>c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(48): error C2144: syntax error : 'int' should be preceded by ';'
1>c:\program files (x86)\windows kits\8.0\include\shared\rpcndr.h(48): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(116): error C2146: syntax error : missing ';' before identifier 'OLECHAR'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(116): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(118): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(118): error C2373: 'OLECHAR' : redefinition; different type modifiers
1> c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(114) : see declaration of 'OLECHAR'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(118): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(423): error C2146: syntax error : missing ';' before identifier 'BYTE_BLOB'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(423): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(431): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(431): error C2371: 'WORD_BLOB' : redefinition; different basic types
1> c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(429) : see declaration of 'WORD_BLOB'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(431): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(439): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(439): error C2371: 'DWORD_BLOB' : redefinition; different basic types
1> c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(437) : see declaration of 'DWORD_BLOB'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(439): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(448): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(448): error C2371: 'FLAGGED_BYTE_BLOB' : redefinition; different basic types
1> c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(446) : see declaration of 'FLAGGED_BYTE_BLOB'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(448): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(457): error C2143: syntax error : missing ';' before '*'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(457): error C2371: 'FLAGGED_WORD_BLOB' : redefinition; different basic types
1> c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(455) : see declaration of 'FLAGGED_WORD_BLOB'
1>c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(457): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(405): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(405): error C2371: 'userCLIPFORMAT' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(403) : see declaration of 'userCLIPFORMAT'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(405): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(430): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(430): error C2371: 'userHGLOBAL' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(428) : see declaration of 'userHGLOBAL'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.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\shared\wtypes.h(517): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(517): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(517): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(519): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(519): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(519): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(521): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(521): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(521): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(523): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(523): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(523): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(525): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(525): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(525): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(527): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(527): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(527): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(529): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(529): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(529): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(531): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(531): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(531): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(533): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(533): error C2371: 'RemotableHandle' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(515) : see declaration of 'RemotableHandle'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(533): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(611): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(611): error C2371: 'userHBITMAP' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(494) : see declaration of 'userHBITMAP'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(611): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(613): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(613): error C2371: 'userHPALETTE' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(505) : see declaration of 'userHPALETTE'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(613): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(615): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(615): error C2371: 'userHENHMETAFILE' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(471) : see declaration of 'userHENHMETAFILE'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(615): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(617): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(617): error C2371: 'userHMETAFILE' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(441) : see declaration of 'userHMETAFILE'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(617): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(619): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(619): error C2371: 'userHMETAFILEPICT' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(460) : see declaration of 'userHMETAFILEPICT'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(619): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(733): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(733): error C2371: 'FLAGGED_WORD_BLOB' : redefinition; different basic types
1> c:\program files (x86)\windows kits\8.0\include\shared\wtypesbase.h(455) : see declaration of 'FLAGGED_WORD_BLOB'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(733): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(941): error C2146: syntax error : missing ';' before identifier 'pFileExt'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(941): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(942): error C2146: syntax error : missing ';' before identifier 'pMimeType'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(942): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(943): error C2146: syntax error : missing ';' before identifier 'pProgId'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(943): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(944): error C2146: syntax error : missing ';' before identifier 'pFileName'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(944): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(947): error C2146: syntax error : missing ';' before identifier 'pPackageName'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h(947): 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\unknwnbase.h(140): error C2061: syntax error : identifier '__RPC__deref_out'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(309): error C2061: syntax error : identifier '__RPC__deref_out'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(431): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(431): error C2371: 'IClassFactory' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(59) : see declaration of 'IClassFactory'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(431): 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\unknwnbase.h(524): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(524): error C2146: syntax error : missing ')' before identifier 'IClassFactory'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(524): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(526): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(537): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(537): error C2146: syntax error : missing ')' before identifier 'IClassFactory'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(537): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(538): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(575): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(575): error C2146: syntax error : missing ')' before identifier 'IClassFactory'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(575): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(577): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(585): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(585): error C2146: syntax error : missing ')' before identifier 'IClassFactory'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(585): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\unknwnbase.h(586): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1376): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1376): error C2371: 'IMultiQI' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(94) : see declaration of 'IMultiQI'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1376): 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\objidlbase.h(1694): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1694): error C2371: 'IEnumUnknown' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(115) : see declaration of 'IEnumUnknown'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1694): 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\objidlbase.h(1805): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1805): error C2146: syntax error : missing ')' before identifier 'IEnumUnknown'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1805): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1808): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1828): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1828): error C2371: 'IEnumString' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(122) : see declaration of 'IEnumString'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1828): 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\objidlbase.h(1937): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1937): error C2146: syntax error : missing ')' before identifier 'IEnumString'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1937): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(1940): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2061): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2061): error C2146: syntax error : missing ')' before identifier 'ISequentialStream'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2061): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2064): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2075): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2075): error C2146: syntax error : missing ')' before identifier 'ISequentialStream'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2075): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2078): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2098): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2098): error C2371: 'IStream' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(136) : see declaration of 'IStream'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2098): 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\objidlbase.h(2120): error C2146: syntax error : missing ';' before identifier 'pwcsName'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2120): 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\objidlbase.h(2361): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2361): error C2146: syntax error : missing ')' before identifier 'IStream'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2361): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2364): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2375): error C2065: '__RPC__in' : undeclared identifier
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2375): error C2146: syntax error : missing ')' before identifier 'IStream'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2375): warning C4229: anachronism used : modifiers on data are ignored
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(2379): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(3896): error C2061: syntax error : identifier '__RPC__deref_out_opt'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(3914): error C2061: syntax error : identifier '__RPC__in_opt'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(4072): error C2061: syntax error : identifier '__RPC__deref_out_opt'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(4495): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(4495): error C2371: 'ISurrogate' : redefinition; different basic types
1> C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(234) : see declaration of 'ISurrogate'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(4495): 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\objidlbase.h(5981): error C2061: syntax error : identifier '__RPC__out_ecount_part'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\objidlbase.h(5981): fatal error C1003: error count exceeds 100; stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Compiling error in C++ project with C and C++ codes

I've created a C++ project where I use C and C++ codes and have some problems with headers...
OK, I have 3 codes:
basicOCR.cpp
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "preprocessing.h"
#include "basicOCR.h"
preprocessing.c
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include "preprocessing.h"
main.c
#include <stdio.h>
#include <ctype.h>
#include "basicOCR.h"
and my 2 own header files:
basicOCR.h
#include <stdio.h>
#include <ctype.h>
preprocessing.h
#include <stdio.h>
#include <ctype.h>
Whenever I try to compile a project, it compiles basicOCR.cpp without any problems but preprocessing.c and main.c give me syntax errors in cstdlib and xstddef. I know that they are C++ libraries. I read this How to mix C and C++
and tried almost everything but it didn't work.
1> preprocessing.c
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(19): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(19): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(19): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2061: syntax error : identifier 'abs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2061: syntax error : identifier 'atexit'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2061: syntax error : identifier 'atof'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2061: syntax error : identifier 'atoi'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2061: syntax error : identifier 'atol'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2061: syntax error : identifier 'bsearch'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2061: syntax error : identifier 'calloc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2061: syntax error : identifier 'div'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2061: syntax error : identifier 'exit'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2061: syntax error : identifier 'free'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2061: syntax error : identifier 'getenv'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2061: syntax error : identifier 'labs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2061: syntax error : identifier 'ldiv'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2061: syntax error : identifier 'malloc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2061: syntax error : identifier 'mblen'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2061: syntax error : identifier 'mbstowcs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2061: syntax error : identifier 'mbtowc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2061: syntax error : identifier 'qsort'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2061: syntax error : identifier 'rand'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2061: syntax error : identifier 'realloc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2061: syntax error : identifier 'srand'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2061: syntax error : identifier 'strtod'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2061: syntax error : identifier 'strtol'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2061: syntax error : identifier 'strtoul'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2061: syntax error : identifier 'system'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2061: syntax error : identifier 'wcstombs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2061: syntax error : identifier 'wctomb'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(32): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(34): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(34): error C2061: syntax error : identifier 'lldiv'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(34): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef(18): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef(18): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(78): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(78): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(87): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(87): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(98): error C2061: syntax error : identifier 'tr1'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(98): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(98): error C2449: found '{' at file scope (missing function header?)
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(101): error C2059: syntax error : '}'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(125): error C2143: syntax error : missing '{' before ':'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(125): error C2059: syntax error : ':'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(132): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(132): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(141): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(141): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\eh.h(27): fatal error C1189: #error : "eh.h is only for C++!"
1> main.c
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(19): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(19): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(19): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2061: syntax error : identifier 'abs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2061: syntax error : identifier 'atexit'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(21): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2061: syntax error : identifier 'atof'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2061: syntax error : identifier 'atoi'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2061: syntax error : identifier 'atol'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(22): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2061: syntax error : identifier 'bsearch'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2061: syntax error : identifier 'calloc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2061: syntax error : identifier 'div'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(23): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2061: syntax error : identifier 'exit'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2061: syntax error : identifier 'free'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2061: syntax error : identifier 'getenv'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(24): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2061: syntax error : identifier 'labs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2061: syntax error : identifier 'ldiv'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2061: syntax error : identifier 'malloc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(25): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2061: syntax error : identifier 'mblen'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2061: syntax error : identifier 'mbstowcs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2061: syntax error : identifier 'mbtowc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(26): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2061: syntax error : identifier 'qsort'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2061: syntax error : identifier 'rand'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2061: syntax error : identifier 'realloc'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(27): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2061: syntax error : identifier 'srand'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2061: syntax error : identifier 'strtod'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2061: syntax error : identifier 'strtol'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(28): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2061: syntax error : identifier 'strtoul'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2061: syntax error : identifier 'system'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(29): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2061: syntax error : identifier 'wcstombs'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2061: syntax error : identifier 'wctomb'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(30): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(32): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(34): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(34): error C2061: syntax error : identifier 'lldiv'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstdlib(34): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef(18): error C2054: expected '(' to follow 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstddef(18): error C2061: syntax error : identifier 'using'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(78): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(78): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(87): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(87): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(98): error C2061: syntax error : identifier 'tr1'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(98): error C2059: syntax error : ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(98): error C2449: found '{' at file scope (missing function header?)
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(101): error C2059: syntax error : '}'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(125): error C2143: syntax error : missing '{' before ':'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(125): error C2059: syntax error : ':'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(132): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(132): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(141): error C2143: syntax error : missing '{' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xstddef(141): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\eh.h(27): fatal error C1189: #error : "eh.h is only for C++!"
I got that. The solution to this was to make a right click on each C code and Properties>C/C++>Advanced>Compile As and check Compile as C++ Code(/TP)
It looks like vc use c++ headers for c code.
This does not answer the question, but why not just use C++? The only time you need C is when you want to be compatible with different versions of different compilers, which happens when you build a plug-in architecture. In this case you declare plug-in prototypes in a "SDK" header like this:
#ifndef __SDK_H
#define __SDK_H
#ifdef __cplusplus
extern "C"
{
#endif
__declspec(dllexport) return_type calling_convention function_name(parameters);
#ifdef __cplusplus
}
#endif
#endif
Then you can compile your plugin.c which should contain the following:
#include "sdk.h"
return_type function_name(parameters)
{
/*Do stuff here*/
}

Replacing native VS 2010 (VC10) tr1 libraries with Boost.TR1

I have been using VS 2005 (VC8) with Boost.TR1 in the std::tr1 namespace by setting the Include Directories of VS to prioritize the boost tr1 headers as described here.
Now I am moving over to VS 2010 (VC10) and I seem to be getting compilation errors using the same include method.
The Include Directories are set to:
[boost-root]\boost\tr1\tr1
[boost-root]
VC standard include directories
Sample code:
#include <functional>
#include <iostream>
int main(int argc, char ** argv)
{
std::cout << std::tr1::bind(std::minus<int>(), 5, std::tr1::placeholders::_1)(5)
<< std::endl;
return 0;
}
Build output:
1>------ Rebuild All started: Project: test_tr1, Configuration: Release Win32 ------
1>Build started 17/8/2010 1:01:58 PM.
1>_PrepareForClean:
1> Deleting file "Release\test_tr1.lastbuildstate".
1>InitializeBuildStatus:
1> Creating "Release\test_tr1.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> main.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(26): error C2143: syntax error : missing ';' before '<'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(27) : see reference to class template instantiation 'std::tr1::_Unrefwrap<_Type>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(26): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(84): error C2039: '_Remove_reference' : is not a member of 'std::tr1'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(84): error C2143: syntax error : missing ';' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(84): error C2433: '_Remove_reference' : 'inline' not permitted on data declarations
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(84): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(84): error C2988: unrecognizable template declaration/definition
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(84): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(84): error C2039: '_Type' : is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(92): error C2039: '_Remove_reference' : is not a member of 'std::tr1'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(92): error C2039: '_Type' : is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(94): error C2143: syntax error : missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(94): error C2447: '{' : missing function header (old-style formal list?)
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(139): error C2143: syntax error : missing ';' before '<'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(168) : see reference to class template instantiation 'std::_Pair_base<_Ty1,_Ty2>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(139): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(139): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(140): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(140): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(142): error C2061: syntax error : identifier '_Ty1x'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(142): error C2535: 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base(void)' : member function already defined or declared
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(124) : see declaration of 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(148): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(148): error C2143: syntax error : missing ',' before '&'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(153): error C2061: syntax error : identifier '_Ty1x'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(153): error C2535: 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base(void)' : member function already defined or declared
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(124) : see declaration of 'std::_Pair_base<_Ty1,_Ty2>::_Pair_base'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(221): error C2059: syntax error : '<'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(273) : see reference to class template instantiation 'std::pair<_Ty1,_Ty2>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(221): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(222): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(222): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(224): error C2061: syntax error : identifier '_Ty1x'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(224): error C2535: 'std::pair<_Ty1,_Ty2>::pair(void)' : member function already defined or declared
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(181) : see declaration of 'std::pair<_Ty1,_Ty2>::pair'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(230): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(230): error C2143: syntax error : missing ',' before '&'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(236): error C2061: syntax error : identifier '_Ty1x'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(236): error C2535: 'std::pair<_Ty1,_Ty2>::pair(void)' : member function already defined or declared
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/utility(181) : see declaration of 'std::pair<_Ty1,_Ty2>::pair'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(282): error C2143: syntax error : missing ',' before '<'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(284) : see reference to class template instantiation 'std::_Is_checked_helper<_Iter>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(500): error C2143: syntax error : missing ';' before '<'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(504) : see reference to class template instantiation 'std::_Ptr_cat_helper<_Elem,_Elem>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(500): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(503): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(345): error C2143: syntax error : missing ';' before '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(345): error C2433: 'enable_if' : 'inline' not permitted on data declarations
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(345): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(345): error C2988: unrecognizable template declaration/definition
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(345): error C2059: syntax error : '<'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(345): error C2039: 'value' : is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(346): error C2065: '_Ret' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(347): error C2065: '_Rx' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(348): error C2143: syntax error : missing ')' before '__cdecl'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(348): error C3861: '_Rx': identifier not found
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(349): error C2039: 'type' : is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(360): error C2065: '_Rx' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(361): error C2065: '_Rx' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(362): error C2143: syntax error : missing ')' before '__cdecl'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(362): error C3861: '_Rx': identifier not found
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(364): error C2143: syntax error : missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(365): error C2143: syntax error : missing ')' before '__cdecl'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(365): error C3861: '_Rx': identifier not found
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(366): error C2065: '_Callable' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(367): error C2065: '_Rx' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(367): error C2065: '_Rx' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(367): error C2065: '_MyBind' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(368): error C2143: syntax error : missing ';' before '}'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(374): error C2947: expecting '>' to terminate template-argument-list, found '>'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(375): error C2039: 'value' : is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(375): error C2065: 'value' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(375): error C2275: 'std::tr1::_Rx' : illegal use of this type as an expression
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(374) : see declaration of 'std::tr1::_Rx'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(376): error C2065: '_Ret' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(379): error C2947: expecting '>' to terminate template-argument-list, found '>'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(379): error C2974: 'std::tr1::_Callable_fun' : invalid template argument for '_Ty', type expected
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xrefwrap(185) : see declaration of 'std::tr1::_Callable_fun'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(379): error C2975: 'std::tr1::_Callable_fun' : invalid template argument for '_Indirect', expected compile-time constant expression
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xrefwrap(185) : see declaration of 'std::tr1::_Callable_fun'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(380): error C2039: 'type' : is not a member of 'std::tr1::_Callable_fun'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xrefwrap(185) : see declaration of 'std::tr1::_Callable_fun'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(380): error C2065: 'type' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(380): error C2146: syntax error : missing ',' before identifier 'bind'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(380): error C2143: syntax error : missing ')' before '__stdcall'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(380): error C2514: 'std::tr1::_Rx' : class has no constructors
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(374) : see declaration of 'std::tr1::_Rx'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(381): error C2143: syntax error : missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(383): error C2065: '_Callable' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(384): error C2065: '_Ret' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(384): error C2065: '_MyBind' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(385): error C2143: syntax error : missing ';' before '}'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(394): error C2143: syntax error : missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(396): error C2065: '_Callable' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(397): error C2065: '_MyBind' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(398): error C2143: syntax error : missing ';' before '}'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(404): error C2947: expecting '>' to terminate template-argument-list, found '>'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(405): error C2146: syntax error : missing ',' before identifier 'enable_if'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(405): error C2065: 'is_same' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(405): error C2065: '_Ret' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(405): error C2039: 'value' : is not a member of 'std::tr1::_Bind'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/functional(380) : see declaration of 'std::tr1::_Bind'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(406): error C2065: '_Ret' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(409): error C2955: 'std::tr1::_Bind' : use of class template requires template argument list
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\../include/functional(380) : see declaration of 'std::tr1::_Bind'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(410): error C2039: 'type' : is not a member of '`global namespace''
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(410): error C2065: 'type' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(410): error C2146: syntax error : missing ',' before identifier 'bind'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(410): error C2143: syntax error : missing ')' before '__fastcall'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(410): error C2514: 'std::tr1::_Rx' : class has no constructors
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(374) : see declaration of 'std::tr1::_Rx'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(410): error C2059: syntax error : ')'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(411): error C2143: syntax error : missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(413): error C2065: '_Callable' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(414): error C2065: '_Ret' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(414): error C2065: '_MyBind' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(415): error C2143: syntax error : missing ';' before '}'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(424): error C2143: syntax error : missing ';' before '{'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(426): error C2065: '_Callable' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(427): error C2065: '_MyBind' : undeclared identifier
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(428): error C2143: syntax error : missing ';' before '}'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(240): error C2906: 'std::tr1::_Binder<false,1>' : explicit specialization requires 'template <>'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(257): error C2947: expecting '>' to terminate template-argument-list, found '>'
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xxbind1(257): fatal error C1003: error count exceeds 100; stopping compilation
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.48
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
It seems like it is using VC10's tr1 headers instead of boost. What is the correct method to get VS to use Boost.TR1 as a replacement?
Try defining _HAS_CPP0X=0 in the project's set of defines - that's supposed to disable VC10's TR1 support.
Microsoft advises against using _HAS_CPP0X=0 with VS2010. What you can do is:
Use Microsoft's tr1 implementation (not recommended, it's buggy)
Use the boost tr1 features directly from the boost namespace using full qualifiers (e.g. boost::function(..), boost::bind(...), etc.). You get name clashes otherwise.
Use using-declarations