Errors in Xutility after defining _SCL_SECURE_NO_WARNINGS - c++

I am trying to implement a class for calculating the dot product of two vectors.
float dotProduct(vec2 v1, vec2 v2)
{
if (v1.Length() != v2.Length()) { return NULL; }
return (float)std::inner_product(v1.x, v1.y, v2.x, 0.0);
}
When I complie this i get:
Error 1 error C4996: 'std::_Inner_product2': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\numeric 121
So i add #define _SCL_SECURE_NO_WARNINGS
But then I get a bunch of errors in xutility
Error 1 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 2 error C2039: 'iterator_category' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 3 error C2146: syntax error : missing ';' before identifier 'iterator_category' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 4 error C2602: 'std::iterator_traits<_InIt>::iterator_category' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 5 error C2868: 'std::iterator_traits<_InIt>::iterator_category' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 6 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 7 error C2039: 'value_type' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 8 error C2146: syntax error : missing ';' before identifier 'value_type' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 9 error C2602: 'std::iterator_traits<_InIt>::value_type' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 10 error C2868: 'std::iterator_traits<_InIt>::value_type' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 11 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 12 error C2039: 'difference_type' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 13 error C2146: syntax error : missing ';' before identifier 'difference_type' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 14 error C2602: 'std::iterator_traits<_InIt>::difference_type' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 15 error C2868: 'std::iterator_traits<_InIt>::difference_type' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 16 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 17 error C2039: 'pointer' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 18 error C2146: syntax error : missing ';' before identifier 'pointer' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 19 error C2602: 'std::iterator_traits<_InIt>::pointer' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 20 error C2868: 'std::iterator_traits<_InIt>::pointer' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 21 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 22 error C2039: 'reference' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 23 error C2146: syntax error : missing ';' before identifier 'reference' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 24 error C2602: 'std::iterator_traits<_InIt>::reference' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 25 error C2868: 'std::iterator_traits<_InIt>::reference' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 26 error C2665: 'std::_Debug_range2' : none of the 2 overloads could convert all the argument types C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 584

Check the documentation
http://en.cppreference.com/w/cpp/algorithm/inner_product
You are passing values not the iterators. this fuction can create product for longer vectors, so it requires start and end of the data, try this;
std::inner_product(v1.begin(), v1.end(), v2.begin(), 0.0);

Related

Errors when compiling code from Practical Programming 2nd with Custom header

I'm starting with the first example from PPP2nd and immediately I have encountered significant issue with the custom header. I have put the header in the compiler include directory for ease of access. Both VS 2010 and 2012 will not compile. Your help would be greatly appreciated.
#include <std_lib_facilities.h>
int main()
{
cout << "Hello,world\n";
return 0;
}
Error 1 error C2868: 'std::vector<_Ty,_Alloc>::size_type' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 71 1 HelloWorld
Error 2 error C2143: syntax error : missing ';' before '=' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 71 1 HelloWorld
Error 3 error C2238: unexpected token(s) preceding ';' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 71 1 HelloWorld
Error 4 error C2061: syntax error : identifier 'initializer_list' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 80 1 HelloWorld
Error 5 error C2535: 'Vector<T>::Vector(void)' : member function already defined or declared c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 80 1 HelloWorld
Error 6 error C2868: 'std::basic_string<_Elem,_Traits,_Alloc>::size_type' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 102 1 HelloWorld
Error 7 error C2143: syntax error : missing ';' before '=' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 102 1 HelloWorld
Error 8 error C2238: unexpected token(s) preceding ';' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 102 1 HelloWorld
Error 9 error C2143: syntax error : missing ';' before '{' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 213 1 HelloWorld
Error 10 error C2275: 'std::uniform_int_distribution<>' : illegal use of this type as an expression c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 213 1 HelloWorld
Error 11 error C2143: syntax error : missing ';' before '}' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 213 1 HelloWorld
Error 12 error C2988: unrecognizable template declaration/definition c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 222 1 HelloWorld
Error 13 error C2059: syntax error : 'using' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 222 1 HelloWorld
Error 14 error C2143: syntax error : missing ';' before '<' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 15 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 16 error C2988: unrecognizable template declaration/definition c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 17 error C2059: syntax error : '<' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 18 error C2143: syntax error : missing ';' before '{' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 251 1 HelloWorld
Error 19 error C2447: '{' : missing function header (old-style formal list?) c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 251 1 HelloWorld
20 IntelliSense: type name is not allowed c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\std_lib_facilities.h 213 81 HelloWorld
21 IntelliSense: expected a ';' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\std_lib_facilities.h 213 107 HelloWorld
Upgrading to visual studio 2015 allowed me to compile the source file with the customer header file "std_lib_facilities.h" provided by the author.
Thanks all for the guidance and feedback.

Class Template in Header file giving me lots of errors

This following code:
main.cpp:
#include <iostream>
#include <list>
#include <map>
#include <string>
#include "core_table.h"
using std::cout;
using std::endl;
int main() {
core_table<int, int> t;
cout << sizeof(t) << endl;
return 0;
}
core_table.h:
#ifndef CORE_TABLE_H
#define CORE_TABLE_H
template <typename key, typename value>
class core_table {
std::list<key, value> l;
std::map<key, value> m;
public:
};
#endif // !CORE_TABLE_H
is giving me this list of errors in Visual Studio 2017. I don't know how to solve it, since this is my first time trying to structure my code in multiple files.
Severity Code Description Project File Line Suppression State
Error C2516 '_Alloc': is not a legal base class ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 984
Error C2825 '_Alloc': must be a class or namespace when followed by '::' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C2510 '_Alloc': left of '::' must be a class/struct/union ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C3646 'value_type': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C2825 '_Ty': must be a class or namespace when followed by '::' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2510 '_Ty': left of '::' must be a class/struct/union ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2143 syntax error: missing ';' before '*' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2238 unexpected token(s) preceding ';' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 661
Error C3646 'pointer': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 662
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 662
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 337
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 337
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 337
Error C2825 '_Ty': must be a class or namespace when followed by '::' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C2510 '_Ty': left of '::' must be a class/struct/union ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C3646 '_Valty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2146 syntax error: missing '>' before identifier '_Valty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2903 'rebind': symbol is neither a class template nor a function template ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2371 'std::_Get_const_pointer_type<_Alloc,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 353
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 353
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 353
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2903 'rebind': symbol is neither a class template nor a function template ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2371 'std::_Get_void_pointer_type<_Alloc,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 368
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 368
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 368
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2903 'rebind': symbol is neither a class template nor a function template ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2371 'std::_Get_const_void_pointer_type<_Alloc,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 383
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 383
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 383
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C2955 'std::pointer_traits': use of class template requires template argument list ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C2371 'std::_Get_difference_type<_Ty,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C3646 'allocate': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2065 '_Al': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2275 '_Alloc': illegal use of this type as an expression ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2226 syntax error: unexpected type 'std::allocator_traits<_Alloc>::size_type' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2334 unexpected token(s) preceding '{'; skipping apparent function body ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 689
Error C3646 'allocate': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2065 '_Al': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2275 '_Alloc': illegal use of this type as an expression ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2226 syntax error: unexpected type 'std::allocator_traits<_Alloc>::size_type' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2334 unexpected token(s) preceding '{'; skipping apparent function body ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 695
Error C2061 syntax error: identifier 'pointer' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 700
Error C2039 'pointer': is not a member of 'std::allocator_traits<_Alloc>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 990
Error C3646 'pointer': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 990
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 990
Error C2027 use of undefined type 'std::_Replace_first_parameter<_Other,_Ty>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C3646 'type': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C2027 use of undefined type 'std::_Replace_first_parameter<_Other,_Ty>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C2535 'std::list<key,value>::list(unsigned int,const int &)': member function already defined or declared ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\list 923
What am I doing wrong?
Second template argument to std::list should be an allocator, yet you gave it something else - your value, which is int.
As a result, compiler is complaining because int doesn't have any members which allocator should expose.
On a side note, you should make your include files self-sufficient, i.e. they should include all headers they need themselves.

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)

Release configuration build, debug doesn't

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.

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