error C2039: 'fabs': is not a member of '`global namespace'' - c++

My project compiled well, even with full rebuild, then I modified a single parameter in a dialog resource and now it doesn't compile even changing back the parameter, I have many errors, beginning with that:
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(24,18): error C2039: 'fabs': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(24,22): error C3861: 'fabs': identifier not found
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(28,18): error C2039: 'fabsf': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(28,23): error C3861: 'fabsf': identifier not found
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(32,18): error C2039: 'fabsl': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cstdlib(32,23): error C3861: 'fabsl': identifier not found
There's also in cmath:
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(31,18): error C2039: 'acosf': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(31,23): error C3861: 'acosf': identifier not found
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(35,18): error C2039: 'acoshf': is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\cmath(35,24): error C3861: 'acoshf': identifier not found
As it is in side Microsoft files I don't see what I can do.
EDIT: If I select "go to definition" in cmath, it seems that all these function are not declared because of _CRT_FUNCTIONS_REQUIRED not beeing defined, maybe it can help.

As the problem ocured after I modified the resource and I found that fabs was not declared because of _CRT_FUNCTIONS_REQUIRED not set to 1, I checked my resource.h file (comming from the original project) and saw that many definition lines where set and one containing #define _CRT_FUNCTIONS_REQUIRED 0.
I commented out all the lines and uncommented the missing definition, and I was able to compile.

Related

C2039 and C2873 when including `<cctype>` from the STL

I'm trying to compile a project with msvc 2019 compilers that I know has been compiled before. In fact, I'm actually updating the build system for it. I've come across a strange problem with sources from the standard template library. Basically the project includes <cctype> which pulls in the following snippet:
_STD_BEGIN
using _CSTD isalnum;
using _CSTD isalpha;
using _CSTD iscntrl;
using _CSTD isdigit;
using _CSTD isgraph;
using _CSTD islower;
using _CSTD isprint;
using _CSTD ispunct;
using _CSTD isspace;
using _CSTD isupper;
using _CSTD isxdigit;
using _CSTD tolower;
using _CSTD toupper;
using _CSTD isblank;
_STD_END
But these declarations all error with the following when I compile my project.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(38): error C2039: 'isalnum': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(38): error C2873: 'isalnum': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(39): error C2039: 'isalpha': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(39): error C2873: 'isalpha': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(40): error C2039: 'iscntrl': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(40): error C2873: 'iscntrl': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(41): error C2039: 'isdigit': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(41): error C2873: 'isdigit': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(42): error C2039: 'isgraph': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(42): error C2873: 'isgraph': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(43): error C2039: 'islower': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(43): error C2873: 'islower': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(44): error C2039: 'isprint': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(44): error C2873: 'isprint': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(45): error C2039: 'ispunct': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(45): error C2873: 'ispunct': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(46): error C2039: 'isspace': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(46): error C2873: 'isspace': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(47): error C2039: 'isupper': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(47): error C2873: 'isupper': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(48): error C2039: 'isxdigit': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(48): error C2873: 'isxdigit': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(49): error C2039: 'tolower': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(49): error C2873: 'tolower': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(50): error C2039: 'toupper': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(50): error C2873: 'toupper': symbol cannot be used in a using-declaration
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(52): error C2039: 'isblank': is not a member of '`global namespace''
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\cctype(52): error C2873: 'isblank': symbol cannot be used in a using-declaration
The result is the same with both c++11 and c++14. I attempted to make a minimal working example but could not because my toy project that includes and uses <cctype> compiles without problems. Therefore it must be a problem with my project settings somewhere.
I know this is going to be a tough one, but does anybody have any thoughts on what might be happening here?
I had the same error on the macOS platform; the solution for me was to #include <_ctype.h> - this header defines the is* functions.

Visual Studio All c++ functions are not members of global namespace

I recently installed Visual studio as I'm working to pick up c++ more. However in c++, even running something as simple as a hello world code yields me a huge number of errors such as
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstdlib(24,18): error C2039: 'fabs': is not a member of 'global namespace'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstdlib(24,22): error C3861: 'fabs': identifier not found
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstdlib(28,18): error C2039: 'fabsf': is not a member of 'global namespace'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstdlib(28,23): error C3861: 'fabsf': identifier not found
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstdlib(32,18): error C2039: 'fabsl': is not a member of 'global namespace'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\cstdlib(32,23): error C3861: 'fabsl': identifier not found
The error seems to be either an issue with my VS setup or my C++ Distribution. Is this a common issue? Has anyone else seen this before?
Here is the code
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
return 0;
}

Can't include cliext headers (for c++ cli, Visual Studio)

Even with a clean empty dll project that is compiled with /clr and only consists of a single cpp file with
#include <cliext/vector>
and nothing else, the compiler spews
1>------ Build started: Project: test1, Configuration: Debug x64 ------
1>Source.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3331,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3352): message : see reference to class template instantiation 'cliext::BCL_reference<_Cont_t,_Is_ref>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3332,1): error C2805: binary 'operator =' has too few parameters
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3332,1): error C2333: 'cliext::BCL_reference<_Cont_t,_Is_ref>::operator =': error in function declaration; skipping function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3340,1): error C2833: 'operator value_type' is not a recognized operator or type
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3341,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3351,1): error C3646: '_Myval': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\iterator(3351,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(872,1): error C2833: 'operator _Mycont_it' is not a recognized operator or type
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1083): message : see reference to class template instantiation 'cliext::impl::vector_base<_Value_t,_Is_ref>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(872,1): error C2059: syntax error: 'newline'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(873,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(878,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(878,1): error C2535: 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(856): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(883,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(883,1): error C2535: 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(856): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(894,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(894,1): error C2535: 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(856): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::vector_base'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(946,1): error C2061: syntax error: identifier 'iterator'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(953,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(960,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(962,1): error C2535: 'void cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(953): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(971,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(973,1): error C2535: 'void cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(953): message : see declaration of 'cliext::impl::vector_base<_Value_t,_Is_ref>::_Insert'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(991,1): error C3646: 'size_type': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(991,1): error C3646: 'Count_generic': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(992,3): error C2059: syntax error: '{'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(991,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1010,1): error C2061: syntax error: identifier '_Myarray_t'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1026,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1038,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1048,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1061,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1072,1): error C2061: syntax error: identifier 'value_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1129,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1149): message : see reference to class template instantiation 'cliext::impl::vector_select<_Value_t,_Is_ref>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1129,1): error C2535: 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1112): message : see declaration of 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1134,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1134,1): error C2535: 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1112): message : see declaration of 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1145,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1145,1): error C2535: 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1112): message : see declaration of 'cliext::impl::vector_select<_Value_t,_Is_ref>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1194,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1306): message : see reference to class template instantiation 'cliext::impl::vector_select<_Value_t,true>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1194,1): error C2535: 'cliext::impl::vector_select<_Value_t,true>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1177): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1199,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1199,1): error C2535: 'cliext::impl::vector_select<_Value_t,true>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1177): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1210,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1210,1): error C2535: 'cliext::impl::vector_select<_Value_t,true>::vector_select(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1177): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::vector_select'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1216,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1223,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1224,1): error C2535: 'void cliext::impl::vector_select<_Value_t,true>::resize(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1216): message : see declaration of 'cliext::impl::vector_select<_Value_t,true>::resize'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1229,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,1): error C3646: 'value_type': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,1): error C3646: 'default': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,29): error C2143: syntax error: missing ',' before '['
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1234,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1245,1): error C2143: syntax error: missing ')' before ';'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1245,1): error C2059: syntax error: ')'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1245,1): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1291,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1296,1): error C3646: 'insert': unknown override specifier
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1296,17): error C2059: syntax error: '('
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1297,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1301,1): error C2061: syntax error: identifier 'iterator'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1363,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1395): message : see reference to class template instantiation 'cliext::vector<_Value_t>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1363,1): error C2535: 'cliext::vector<_Value_t>::vector(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1335): message : see declaration of 'cliext::vector<_Value_t>::vector'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1368,1): error C2061: syntax error: identifier 'size_type'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1368,1): error C2535: 'cliext::vector<_Value_t>::vector(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1335): message : see declaration of 'cliext::vector<_Value_t>::vector'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1379,1): error C2061: syntax error: identifier '_Myenum_it'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1379,1): error C2535: 'cliext::vector<_Value_t>::vector(void)': member function already defined or declared
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.24.28117\include\cliext\vector(1335): message : see declaration of 'cliext::vector<_Value_t>::vector'
1>Done building project "test1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This happens with VS2017, VS2019 and VS2019 preview, all newest versions. I'm so confused. This doesn't seem like a bug since it's rather old and proven headers and happens in different compilers.
edit: super duper complete code here (with project files): https://gist.github.com/s9w/a65bf50ed928bd0d6629c1d10b013463
edit: To help the people from the future with the same problem: It's the /permissive- switch (conformance mode) - doesn't play well with that header.
To help the people from the future with the same problem: It's the /permissive- switch (conformance mode) - doesn't play well with that header.

ATL complains about not including Windows after VS2012 -> VS2017

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

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