Release configuration build, debug doesn't - c++

I'm developing an AutoCad plugin (MFC dll), I'm using Visual Studio 2010 and C++.
Until now I was building the project with release configuration (both 32 and 64 bits), with no problems (I've test the plugin inside AutoCad).
But now that I want to debug a function with Visual Studio 2010 just changed the configuration to Debug and the build doesn't succeeded.
The output from build process:
------ Build started: Project: SAM, Configuration: Debug x64 ------
Build started 26/01/2012 11:36:32.
InitializeBuildStatus:
Touching "x64\Debug\SAM.unsuccessfulbuild".
ClCompile:
stdafx.cpp
Note: including file: c:\vs2010_workspace\s\sam\stdafx.h
Note: including file: c:\vs2010_workspace\s\sam\targetver.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\SDKDDKVer.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\sal.h
Note: including file: c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h
c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(27): error C2448: 'message' : function-style initializer appears to be a function definition
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h(121): error C2065: 'va_list' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vadefs.h(121): error C2059: syntax error : ','
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(486): error C2146: syntax error : missing ';' before identifier 'time_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(550): error C2061: syntax error : identifier 'uintptr_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1961): error C2146: syntax error : missing ';' before identifier 'locinfo'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1961): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1961): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1962): error C2146: syntax error : missing ';' before identifier 'mbcinfo'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1962): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1962): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1980): error C2146: syntax error : missing ';' before identifier 'lc_id'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1980): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h(1980): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2143: syntax error : missing ';' before '__cdecl'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2065: 'new_handler' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2146: syntax error : missing ')' before identifier '_NewHandler'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(52): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(58): error C2039: 'new_handler' : is not a member of 'std'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new.h(58): error C2873: 'new_handler' : symbol cannot be used in a using-declaration
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxver_.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxv_w32.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winsdkver.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\windows.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\excpt.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdarg.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\windef.h
Note: including file: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h
Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\crtdefs.h
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(57): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(57): error C2143: syntax error : missing ';' before '*'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(57): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(59): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(59): error C2143: syntax error : missing ';' before '*'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(59): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(93): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(95): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(97): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(99): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(101): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(103): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(105): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(107): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(109): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(111): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(113): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(115): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(119): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(121): error C2061: syntax error : identifier '_locale_t'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2491: 'iswalpha' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(135): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2491: '_iswalpha_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(136): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2491: 'iswupper' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(137): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2491: '_iswupper_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(138): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2491: 'iswlower' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(139): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2491: '_iswlower_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(140): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2491: 'iswdigit' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(141): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2491: '_iswdigit_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(142): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2491: 'iswxdigit' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(143): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2491: '_iswxdigit_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(144): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2491: 'iswspace' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(145): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2491: '_iswspace_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(146): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2491: 'iswpunct' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(147): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2491: '_iswpunct_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(148): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2491: 'iswalnum' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(149): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2491: '_iswalnum_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(150): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2491: 'iswprint' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(151): error C2059: syntax error : ')'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): error C2065: 'wint_t' : undeclared identifier
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): error C2146: syntax error : missing ')' before identifier '_C'
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): error C2491: '_iswprint_l' : definition of dllimport data not allowed
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ctype.h(152): fatal error C1003: error count exceeds 100; stopping compilation
Build FAILED.
PS.: I'm not an expert developing whit c++ (I came from Java), I've started just a week ago.
EDIT:
I've commented the piece of code below, and i was able to build. The code was on stdafx.h, and I have no clue of what it mean, someone could explain it to me?
#if defined(_DEBUG) && !defined(_FULLDEBUG_)
#define _DEBUG_WAS_DEFINED
#undef _DEBUG
#pragma
message (" Compiling MFC header files in release mode.")
#endif

You should check your project properties for Debug and for Release configuration and see if you are missing something. I would start with Linker -> Input -> Additional Dependencies and C/C++ -> General -> Additional Include Directories.

I know this answer is a year late, but #pragma and message should be on the same line. Someone probably hit the enter key accidentally. This is why it works in release mode but not debug; _DEBUG is not defined in release configuration.
Visual Studio 2010 has a habit of giving you some weird error messages that should otherwise be straightforward parsing problems.

Related

Migrating MFC app from Visual Studio 2012 to Visual Studio 2013

I'm trying to migrate a MFC project over from Visual Studio 2012 (where it's compiling fine) to Visual Studio 2013 and I'm getting a heap of undefined errors as per below.
These are all caused when pulling in the precompiled header - and I can only assume I'm including some of the MFC header files in the wrong order - anyone know what order they should be now?
The errors indicate that PGESTURECONFIG is defined in WinUser.h - but it doesn't like me including that anywhere before afxwin.h (it produces different errors if I do indicating "No Target Architecture")
This is what I believe is the relevant section is in the precompiled header currently:
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
#include <afxcview.h> // MFC CTreeView, etc...
And this is the kind of errors I'm getting:
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2092): error C2146: syntax error : missing ';' before identifier 'm_pConfigs'
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2092): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2019): error C2065: 'GID_ZOOM' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2019): error C2065: 'GC_ZOOM' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2025): error C2065: 'GID_ROTATE' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2025): error C2065: 'GC_ROTATE' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2031): error C2065: 'GID_TWOFINGERTAP' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2031): error C2065: 'GC_TWOFINGERTAP' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2045): error C2065: 'GID_PAN' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2045): error C2065: 'GC_PAN' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2051): error C2065: 'GID_PAN' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2051): error C2065: 'GC_PAN_WITH_SINGLE_FINGER_VERTICALLY' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2057): error C2065: 'GID_PAN' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2057): error C2065: 'GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2063): error C2065: 'GID_PAN' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2063): error C2065: 'GC_PAN_WITH_GUTTER' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2069): error C2065: 'GID_PAN' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2069): error C2065: 'GC_PAN_WITH_INERTIA' : undeclared identifier
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2953): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2953): error C2146: syntax error : missing ';' before identifier 'GetCurrentGestureInfo'
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2954): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2956): warning C4183: 'GetCurrentGestureInfo': missing return type; assumed to be a member function returning 'int'
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2986): error C2061: syntax error : identifier 'PTOUCHINPUT'
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2996): error C2061: syntax error : identifier 'PTOUCHINPUT'
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(3009): error C2146: syntax error : missing ';' before identifier 'm_pCurrentGestureInfo'
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(3009): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
3>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afxwin.h(2955): error C2065: 'm_pCurrentGestureInfo' : undeclared identifier
Any advice appreciated.
I had exactly the same problem today after converting a Visual Studio 2010 project to Visual Studio 2013.
In my case, it turned out to be "hard coded" WINVER define injected via the project's C++ configuration properties (preprocessor definition section), where WINVER=0x500 was defined ages ago.
I solved it by setting Properties -> C/C++ Preprocessor Definitions to
NTDDI_VERSION= 0x06030000;WINVER=0x0A00;_WIN32_WINNT=0x0A00;%(PreprocessorDefinitions)
I have added these settings into stdafx.h file and it worked for me:
WINVER=0x601;
_WIN32_WINNT=0x601;
_WIN32_WINDOWS=0x601;
_WIN32_IE=0x601;

build error with xtgmath.h and cmath

I recently installed GLUT, and GLEW, and was running some OpenGL example code the other day. I come back to my project and try to run some basic c++ code:
#include <iostream>
int main()
{
using namespace std;
cout << "Come up and C++ me some time.";
cout << endl;
cout << "You won’t regret it!" << endl;
return 0;
}
I am using Visual Studio 2013, and the file is C++. Anyway, I get these errors:
1>------ Build started: Project: testGlut1, Configuration: Debug Win32 ------
1> Source.cpp
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h(214): error C2220: warning treated as error - no 'object' file generated
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h(214): warning C4602: #pragma pop_macro : 'new' no previous #pragma push_macro for this identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h(215): warning C4193: #pragma warning(pop) : no matching '#pragma warning(push)'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h(216): warning C4161: #pragma pack(pop...) : more pops than pushes
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(23): error C2061: syntax error : identifier 'abs'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(23): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(23): error C2061: syntax error : identifier 'acos'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(23): error C2061: syntax error : identifier 'asin'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(24): error C2061: syntax error : identifier 'atan'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(24): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(24): error C2061: syntax error : identifier 'atan2'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(24): error C2061: syntax error : identifier 'ceil'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(25): error C2061: syntax error : identifier 'cos'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(25): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(25): error C2061: syntax error : identifier 'cosh'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(25): error C2061: syntax error : identifier 'exp'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(26): error C2061: syntax error : identifier 'fabs'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(26): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(26): error C2061: syntax error : identifier 'floor'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(26): error C2061: syntax error : identifier 'fmod'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(27): error C2061: syntax error : identifier 'frexp'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(27): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(27): error C2061: syntax error : identifier 'ldexp'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(27): error C2061: syntax error : identifier 'log'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(28): error C2061: syntax error : identifier 'log10'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(28): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(28): error C2061: syntax error : identifier 'modf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(28): error C2061: syntax error : identifier 'pow'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(29): error C2061: syntax error : identifier 'sin'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(29): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(29): error C2061: syntax error : identifier 'sinh'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(29): error C2061: syntax error : identifier 'sqrt'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(30): error C2061: syntax error : identifier 'tan'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(30): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(30): error C2061: syntax error : identifier 'tanh'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(32): error C2061: syntax error : identifier 'acosf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(32): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(32): error C2061: syntax error : identifier 'asinf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(33): error C2061: syntax error : identifier 'atanf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(33): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(33): error C2061: syntax error : identifier 'atan2f'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(33): error C2061: syntax error : identifier 'ceilf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(34): error C2061: syntax error : identifier 'cosf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(34): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(34): error C2061: syntax error : identifier 'coshf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(34): error C2061: syntax error : identifier 'expf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(35): error C2061: syntax error : identifier 'fabsf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(35): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(35): error C2061: syntax error : identifier 'floorf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(35): error C2061: syntax error : identifier 'fmodf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(36): error C2061: syntax error : identifier 'frexpf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(36): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(36): error C2061: syntax error : identifier 'ldexpf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(36): error C2061: syntax error : identifier 'logf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(37): error C2061: syntax error : identifier 'log10f'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(37): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(37): error C2061: syntax error : identifier 'modff'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(37): error C2061: syntax error : identifier 'powf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(38): error C2061: syntax error : identifier 'sinf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(38): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(38): error C2061: syntax error : identifier 'sinhf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(38): error C2061: syntax error : identifier 'sqrtf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(39): error C2061: syntax error : identifier 'tanf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(39): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(39): error C2061: syntax error : identifier 'tanhf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(41): error C2061: syntax error : identifier 'acosl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(41): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(41): error C2061: syntax error : identifier 'asinl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(42): error C2061: syntax error : identifier 'atanl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(42): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(42): error C2061: syntax error : identifier 'atan2l'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(42): error C2061: syntax error : identifier 'ceill'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(43): error C2061: syntax error : identifier 'cosl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(43): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(43): error C2061: syntax error : identifier 'coshl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(43): error C2061: syntax error : identifier 'expl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(44): error C2061: syntax error : identifier 'fabsl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(44): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(44): error C2061: syntax error : identifier 'floorl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(44): error C2061: syntax error : identifier 'fmodl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(45): error C2061: syntax error : identifier 'frexpl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(45): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(45): error C2061: syntax error : identifier 'ldexpl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(45): error C2061: syntax error : identifier 'logl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(46): error C2061: syntax error : identifier 'log10l'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(46): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(46): error C2061: syntax error : identifier 'modfl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(46): error C2061: syntax error : identifier 'powl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(47): error C2061: syntax error : identifier 'sinl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(47): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(47): error C2061: syntax error : identifier 'sinhl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(47): error C2061: syntax error : identifier 'sqrtl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(48): error C2061: syntax error : identifier 'tanl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(48): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(48): error C2061: syntax error : identifier 'tanhl'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(50): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(50): error C2054: expected '(' to follow 'using'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(50): error C2061: syntax error : identifier 'using'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(52): error C2061: syntax error : identifier 'acosh'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(52): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(52): error C2061: syntax error : identifier 'asinh'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(52): error C2061: syntax error : identifier 'atanh'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(53): error C2061: syntax error : identifier 'cbrt'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(53): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(53): error C2061: syntax error : identifier 'erf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(53): error C2061: syntax error : identifier 'erfc'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath(53): fatal error C1003: error count exceeds 100; stopping compilation
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The compiler processes your file as C. Specify that need to be compiled as C ++.(http://msdn.microsoft.com/en-us/library/032xwy55.aspx)

Visual Studio 2013 for Windows Store's New Project "DirectX App" won't compile vanilla

I just installed Visual Studio 2013 for Windows (This is the version for Windows Store).
I then read the quite helpful tutorial over at MSDN on DirectX for Windows Store.
It gives instructions as follows: Click new project. Click DirectX App. It should Compile and run.
It doesn't. Instead, I'm getting the following errors:
1>------ Build started: Project: Sequence, Configuration: Debug Win32 ------
1> pch.cpp
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(1): error C2018: unknown character '0x8'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(1): error C2018: unknown character '0x15'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x1'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier '‘×ÿ'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x5'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'H‹'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2143: syntax error : missing ';' before '|'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C3872: '0x24': this character is not allowed in an identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x15'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x40'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x60'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2143: syntax error : missing ')' before ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'L‹L$'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'L‹D$HH‹T$P3Éÿ'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier ''
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2014: preprocessor command must start as first nonwhite space
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'ë'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x4'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'H‹H‰'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'ØH‹'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x8'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier '×HƒÀ'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'H‰'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier '’×H‹'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2017: illegal escape sequence
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'ë×H‰'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2146: syntax error : missing ';' before identifier 'ÖH‹„$H‰'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2143: syntax error : missing ';' before ']'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x3'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C3872: '0x4': this character is not allowed in an identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x2'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x17'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x14'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2018: unknown character '0x1f'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2): error C2001: newline in constant
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2018: unknown character '0x8'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2018: unknown character '0x3'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2143: syntax error : missing ')' before ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2018: unknown character '0xe'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2146: syntax error : missing ';' before identifier 'AÿÁHƒÀ'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2065: 'E' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2017: illegal escape sequence
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2146: syntax error : missing ';' before identifier '$'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2146: syntax error : missing ';' before identifier 'WHē'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2146: syntax error : missing ';' before identifier 'H‹ÙH'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): warning C4129: '$' : unrecognized character escape sequence
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2001: newline in constant
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2065: 'àþÿH‹ÏèD…Àt' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(3): error C2143: syntax error : missing ';' before 'string'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(4): error C2018: unknown character '0x40'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(4): error C2018: unknown character '0x1'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x5'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x40'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x8'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x1'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0xf'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2143: syntax error : missing ')' before ';'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2146: syntax error : missing ';' before identifier 'ÈÈH…Ét'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2086: 'int H‹' : redefinition
1> c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(2) : see declaration of 'H‹'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2146: syntax error : missing ';' before identifier 'è–ðÿÿHƒ'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2143: syntax error : missing ';' before '%'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C3699: '%' : cannot use this indirection on type 'int'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2530: '¶Èƒ' : references must be initialized
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2530: '·Èƒ' : references must be initialized
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x15'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2146: syntax error : missing ';' before identifier 'qÈÿ'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2530: '´ÈH' : references must be initialized
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2146: syntax error : missing ';' before identifier 'ãùƒ'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2017: illegal escape sequence
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2146: syntax error : missing ';' before identifier 'ÈH…Ét'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2530: 'ÈH‹' : references must be initialized
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2146: syntax error : missing ';' before identifier 'è'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2065: 'ðÿÿHƒ' : undeclared identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2059: syntax error : '{'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2143: syntax error : missing ';' before '{'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2447: '{' : missing function header (old-style formal list?)
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x2'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x10'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x3'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C3872: '0x24': this character is not allowed in an identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x16'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x17'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C3872: '0x4': this character is not allowed in an identifier
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2015: too many characters in constant
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x18'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x1c'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x11'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x6'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x13'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x7f'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2018: unknown character '0x12'
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): error C2014: preprocessor command must start as first nonwhite space
1>c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0(5): fatal error C1004: unexpected end-of-file found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Obviously my internet search turned up nothing. I'm sorry, but I've never used DirectX before, and I simply hoped to start doing stuff with the sample, so I don't have any background on how to debug these errors. They sound not even related to DirectX.
This may or may not be important. I have had a number of problems with DirectX (not for development) before. A number of games I own will not start, complaining about DirectX doing something wrong. Whenever I try to run a DirectX runtime standalone installer, I get the message, "This version of DirectX is not compatible with the version of windows currently installed." I don't know if this is related. (And it's a whole other thing I've spent tons of time trying to fix, finding no information on, but that's a whole different story.)
I run Windows 8.1 (It was originally Windows 8 and I updated normally.) DXDiag says I have DirectX 11.
This has been quite frustrating, as when code doesn't work, I expect it to be my fault. When my compiler is given good code and it doesn't work, I get frustrated. Thank you for helping.
EDIT: Thanks to #Drop, for pointing out the obviously corrupted nature of xmemory0 (in contrast with the plaintext in the others in that folder, this file looked like a nuclear meltdown). So if any of you could simply copy and paste in their xmemory0 to an answer, (to save me the trouble of reinstalling) I would be very glad. Thanks!
EDIT 2: OK, looks like indeed there are a number of corrupted files and re-installing VS for Desktop and for Windows Store did nothing to fix them. I tried copying files from VS 2012, but those too give errors, this time unrelated to a corrupted file. So what I am now asking for is please a zipped up include directory (C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include). Thank you!

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