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);
I get the above error and about 101 others (total 102 errors). I searched around and the only solution I found is to include the windows.h library before gl.h. But I am already doing that. So what is the solution? Can anyone help me? I am using glut and opengl. Below is my include process. If you request more of my code let me know
#include <stdio.h> // Standard C/C++ Input-Output
#include <math.h> // Math Functions
#include <windows.h> // Standard Header For MSWindows Applications
#include <GL/gl.h>
#include <time.h>
#include <stdlib.h>
#include "SOIL.h"
and this is the complete error list:
Error 1 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 2 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 3 error C2146: syntax error : missing ',' before identifier 'glAccum' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 4 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 5 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 6 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 7 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 8 error C2146: syntax error : missing ',' before identifier 'glAlphaFunc' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 9 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 10 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 11 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 12 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 13 error C2146: syntax error : missing ',' before identifier 'glAreTexturesResident' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 14 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 15 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 16 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 17 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 18 error C2146: syntax error : missing ',' before identifier 'glArrayElement' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 19 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 20 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 21 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 22 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 23 error C2146: syntax error : missing ',' before identifier 'glBegin' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 24 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 25 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 26 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 27 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 28 error C2146: syntax error : missing ',' before identifier 'glBindTexture' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 29 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 30 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 31 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 32 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 33 error C2146: syntax error : missing ',' before identifier 'glBitmap' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 34 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 35 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 36 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 37 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 38 error C2146: syntax error : missing ',' before identifier 'glBlendFunc' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 39 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 40 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 41 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 42 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 43 error C2146: syntax error : missing ',' before identifier 'glCallList' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 44 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 45 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 46 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 47 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 48 error C2146: syntax error : missing ',' before identifier 'glCallLists' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 49 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 50 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 51 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 52 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 53 error C2146: syntax error : missing ',' before identifier 'glClear' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 54 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 55 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 56 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 57 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 58 error C2146: syntax error : missing ',' before identifier 'glClearAccum' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 59 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 60 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 61 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 62 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 63 error C2146: syntax error : missing ',' before identifier 'glClearColor' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 64 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 65 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 66 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 67 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 68 error C2146: syntax error : missing ',' before identifier 'glClearDepth' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 69 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 70 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 71 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 72 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 73 error C2146: syntax error : missing ',' before identifier 'glClearIndex' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 74 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 75 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 76 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 77 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 78 error C2146: syntax error : missing ',' before identifier 'glClearStencil' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 79 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 80 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 81 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 82 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 83 error C2146: syntax error : missing ',' before identifier 'glClipPlane' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 84 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 85 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 86 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 87 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 88 error C2146: syntax error : missing ',' before identifier 'glColor3b' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 89 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 90 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 91 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 92 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 93 error C2146: syntax error : missing ',' before identifier 'glColor3bv' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 94 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 95 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 96 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 97 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 98 error C2146: syntax error : missing ',' before identifier 'glColor3d' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 99 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 100 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 101 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1172
Error 102 error C1003: error count exceeds 100; stopping compilation c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1172
This is commonly caused by defining WIN32_LEAN_AND_MEAN, either in stdafx.h or in the compilation settings.
Defining that macro before including windows.h automatically excludes infrequently used header files and definitions.
Since you are using OpenGL you are using some of those infrequently used headers, so you need to turn that off.
It may appear in a header such as stdafx.h like so:
#define WIN32_LEAN_AND_MEAN
Or it may be in the compilation settings like so:
-DWIN32_LEAN_AND_MEAN
You forget to include windows.h right before gl.h. From http://www.opengl.org/archives/resources/faq/technical/gettingstarted.htm:
Error:
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2054: expected '(' to
follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2085: 'APIENTRY' : not in
formal parameter list
Didn't #include windows.h or included it after gl.h. Source files that
use neither GLUT nor MFC, but which make calls to OpenGL, should:
#include <windows.h>
#include <GL/gl.h>
Works for me.
Also, make sure you are not using precompiled header
OK I had the same problem and i fixed it . Just Make sure you dont have other files in your project (precompiled header /.c/ .cpp).Delete them and leave only thouse wich you need and it will work
It seems like you are using the SOIL library. Make sure that windows.h is included (the preprocessor might take a different branch). Ensure that WIN32 is defined if you do not want to change the SOIL library. If not, you can replace it by _WIN32.
This all seems to be pretty much wrong guys (sorry!).
Simply because this loudly proclaims that
including windows.h is needed does not mean that
including windows.h should be done.
OpenGL is an OPEN STANDARD PROTOCOL INTERFACE SPEC. Thus,
its related STANDARD headers (GL/gl.h , GL/glu.h etc.) should DEFINITELY NOT be causing massive pollution with
whichever proprietary crap some proprietary vendors manage to come up with.
Specifically, I am talking of
woefully Win32-specific macros WINGDIAPI and APIENTRY, which
have been ADDED TO
previously standard GL header content (hint: see SGI text in that header), and which
cause these GL headers to NOT be a properly self-contained and generic interface any more!!
(i.e., requiring a whole ton of wingdi.h and kitchen sink etc., with the massive consequence of globally polluting your entire source code scope with this wholly environment-specific crap, windows.h etc)
Thus, to rectify this dire situation, things likely should be done like this:
create purpose-specific local headers which try to do a maximally precise job of
supplying these few required-but-missing (non-self-contained header!) environment-specific parts:
APIENTRY definition header file
WINGDIAPI definition header file
supply these missing parts (broken since non-self-contained OpenGL interface...) by including these helper headers everywhere that you include related official GL headers (interfaces!) - on the Windows-proprietary platform only (#ifdef _WIN32)!
take uttermost care to keep any and all Windows-proprietary transition-to-OpenGL helpers (those which make use of Win32 HDC etc., e.g. wgl*() APIs) handling to their own properly strictly isolated translation unit (.cpp)
keep all of your standard / generic / cross-platform / universal (read: innocent ;-)) OpenGL implementation handling parts to their own translation units (thus, cleanly NOT infected by environment-specific windows.h crap, thus properly working on all platforms)
profit! (hopefully)
Topically related reference (potentially already helpful):
github WindowsHModular
Topically related stuff:
Win32 min / max macro "namespace" / symbol pollution (early-define NOMINMAX and prefer using __min / __max where still needed)
Win32 near / far macros
The fact remains that it is very intrusive behaviour to be polluting a standard, minimalist(?) interface (OpenGL) with negligible parts (in this case, symbol export macros) of a factually foreign toolkit, thereby necessitating sufficiently (header-side!) global-scope pollution of supposedly generic user code with wholly environment-specific crap: windows.h (as opposed to simply ensuring that these public interface headers have their own compiler-specific symbol export macros provided within scope already).
tl;dr: "One platform enabled, eleven platforms broken - job achieved"
When I add the string library (#include <string>) I get around 100 errors when compiling. Windows.h is already included so I don't know what the problem is.
Any help would be appreciated.
Errors are listed below.
Error 105 error C1003: error count exceeds 100; stopping compilation C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio 39 1 STablUpd
Error 99 error C2054: expected '(' to follow 'using' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio 36 1 STablUpd
Error 101 error C2054: expected '(' to follow 'using' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio 38 1 STablUpd
Error 5 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 28 1 STablUpd
Error 8 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 29 1 STablUpd
Error 12 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 30 1 STablUpd
Error 16 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 31 1 STablUpd
Error 20 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 32 1 STablUpd
Error 24 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 33 1 STablUpd
Error 28 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 34 1 STablUpd
Error 32 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 35 1 STablUpd
Error 35 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 37 1 STablUpd
Error 38 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 38 1 STablUpd
Error 42 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 39 1 STablUpd
Error 46 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 40 1 STablUpd
Error 50 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 41 1 STablUpd
Error 54 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 42 1 STablUpd
Error 58 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 43 1 STablUpd
Error 62 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 44 1 STablUpd
Error 65 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 46 1 STablUpd
Error 67 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 48 1 STablUpd
Error 70 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 49 1 STablUpd
Error 74 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 50 1 STablUpd
Error 78 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 51 1 STablUpd
Error 82 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 52 1 STablUpd
Error 86 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 53 1 STablUpd
Error 90 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 54 1 STablUpd
Error 94 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 55 1 STablUpd
Error 97 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 57 1 STablUpd
Error 103 error C2059: syntax error : ';' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio 39 1 STablUpd
Error 64 error C2061: syntax error : identifier 'abs' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 46 1 STablUpd
Error 66 error C2061: syntax error : identifier 'acos' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 48 1 STablUpd
Error 4 error C2061: syntax error : identifier 'acosf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 28 1 STablUpd
Error 34 error C2061: syntax error : identifier 'acosl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 37 1 STablUpd
Error 68 error C2061: syntax error : identifier 'asin' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 48 1 STablUpd
Error 6 error C2061: syntax error : identifier 'asinf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 28 1 STablUpd
Error 36 error C2061: syntax error : identifier 'asinl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 37 1 STablUpd
Error 69 error C2061: syntax error : identifier 'atan' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 49 1 STablUpd
Error 71 error C2061: syntax error : identifier 'atan2' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 49 1 STablUpd
Error 9 error C2061: syntax error : identifier 'atan2f' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 29 1 STablUpd
Error 39 error C2061: syntax error : identifier 'atan2l' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 38 1 STablUpd
Error 7 error C2061: syntax error : identifier 'atanf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 29 1 STablUpd
Error 37 error C2061: syntax error : identifier 'atanl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 38 1 STablUpd
Error 72 error C2061: syntax error : identifier 'ceil' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 49 1 STablUpd
Error 10 error C2061: syntax error : identifier 'ceilf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 29 1 STablUpd
Error 40 error C2061: syntax error : identifier 'ceill' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 38 1 STablUpd
Error 102 error C2061: syntax error : identifier 'clearerr' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio 39 1 STablUpd
Error 73 error C2061: syntax error : identifier 'cos' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 50 1 STablUpd
Error 11 error C2061: syntax error : identifier 'cosf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 30 1 STablUpd
Error 75 error C2061: syntax error : identifier 'cosh' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 50 1 STablUpd
Error 13 error C2061: syntax error : identifier 'coshf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 30 1 STablUpd
Error 43 error C2061: syntax error : identifier 'coshl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 39 1 STablUpd
Error 41 error C2061: syntax error : identifier 'cosl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 39 1 STablUpd
Error 76 error C2061: syntax error : identifier 'exp' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 50 1 STablUpd
Error 14 error C2061: syntax error : identifier 'expf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 30 1 STablUpd
Error 44 error C2061: syntax error : identifier 'expl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 39 1 STablUpd
Error 77 error C2061: syntax error : identifier 'fabs' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 51 1 STablUpd
Error 15 error C2061: syntax error : identifier 'fabsf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 31 1 STablUpd
Error 45 error C2061: syntax error : identifier 'fabsl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 40 1 STablUpd
Error 104 error C2061: syntax error : identifier 'fclose' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio 39 1 STablUpd
Error 79 error C2061: syntax error : identifier 'floor' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 51 1 STablUpd
Error 17 error C2061: syntax error : identifier 'floorf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 31 1 STablUpd
Error 47 error C2061: syntax error : identifier 'floorl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 40 1 STablUpd
Error 80 error C2061: syntax error : identifier 'fmod' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 51 1 STablUpd
Error 18 error C2061: syntax error : identifier 'fmodf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 31 1 STablUpd
Error 48 error C2061: syntax error : identifier 'fmodl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 40 1 STablUpd
Error 81 error C2061: syntax error : identifier 'frexp' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 52 1 STablUpd
Error 19 error C2061: syntax error : identifier 'frexpf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 32 1 STablUpd
Error 49 error C2061: syntax error : identifier 'frexpl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 41 1 STablUpd
Error 96 error C2061: syntax error : identifier 'hypot' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 57 1 STablUpd
Error 98 error C2061: syntax error : identifier 'hypotf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 57 1 STablUpd
Error 83 error C2061: syntax error : identifier 'ldexp' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 52 1 STablUpd
Error 21 error C2061: syntax error : identifier 'ldexpf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 32 1 STablUpd
Error 51 error C2061: syntax error : identifier 'ldexpl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 41 1 STablUpd
Error 84 error C2061: syntax error : identifier 'log' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 52 1 STablUpd
Error 85 error C2061: syntax error : identifier 'log10' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 53 1 STablUpd
Error 23 error C2061: syntax error : identifier 'log10f' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 33 1 STablUpd
Error 53 error C2061: syntax error : identifier 'log10l' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 42 1 STablUpd
Error 22 error C2061: syntax error : identifier 'logf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 32 1 STablUpd
Error 52 error C2061: syntax error : identifier 'logl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 41 1 STablUpd
Error 87 error C2061: syntax error : identifier 'modf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 53 1 STablUpd
Error 25 error C2061: syntax error : identifier 'modff' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 33 1 STablUpd
Error 55 error C2061: syntax error : identifier 'modfl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 42 1 STablUpd
Error 88 error C2061: syntax error : identifier 'pow' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 53 1 STablUpd
Error 26 error C2061: syntax error : identifier 'powf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 33 1 STablUpd
Error 56 error C2061: syntax error : identifier 'powl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 42 1 STablUpd
Error 89 error C2061: syntax error : identifier 'sin' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 54 1 STablUpd
Error 27 error C2061: syntax error : identifier 'sinf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 34 1 STablUpd
Error 91 error C2061: syntax error : identifier 'sinh' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 54 1 STablUpd
Error 29 error C2061: syntax error : identifier 'sinhf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 34 1 STablUpd
Error 59 error C2061: syntax error : identifier 'sinhl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 43 1 STablUpd
Error 57 error C2061: syntax error : identifier 'sinl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 43 1 STablUpd
Error 92 error C2061: syntax error : identifier 'sqrt' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 54 1 STablUpd
Error 30 error C2061: syntax error : identifier 'sqrtf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 34 1 STablUpd
Error 60 error C2061: syntax error : identifier 'sqrtl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 43 1 STablUpd
Error 93 error C2061: syntax error : identifier 'tan' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 55 1 STablUpd
Error 31 error C2061: syntax error : identifier 'tanf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 35 1 STablUpd
Error 95 error C2061: syntax error : identifier 'tanh' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 55 1 STablUpd
Error 33 error C2061: syntax error : identifier 'tanhf' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 35 1 STablUpd
Error 63 error C2061: syntax error : identifier 'tanhl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 44 1 STablUpd
Error 61 error C2061: syntax error : identifier 'tanl' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cmath 44 1 STablUpd
Error 100 error C2061: syntax error : identifier 'using' C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\cstdio 38 1 STablUpd
For anyone who is still looking for this:
"The solution to this was to make a right click on each C code and Properties>C/C++>Advanced>Compile As and check Compile as C++ Code(/TP)"
source: stack overflow :)
My project is not happy regarding include cstring. It generates errors like:
Error 10 error C2061: syntax error : identifier 'using' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring 18 1 fgdll
Error 95 error C2061: syntax error : identifier 'tanhf' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath 26 1 fgdll
Error 93 error C2061: syntax error : identifier 'tanf' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cmath 26 1 fgdll
Error 51 error C2061: syntax error : identifier 'strxfrm' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring 26 1 fgdll
Error 49 error C2061: syntax error : identifier 'strtok' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring 26 1 fgdll
Error 47 error C2061: syntax error : identifier 'strstr' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\cstring 25 1 fgdll
...
How can I solve this problem?
Ok, try this:
Right click on each piece of code and go to:
Properties > C/C++ > Advanced > Compile As and check Compile as C++ Code(/TP)
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.