expected '(' to follow 'WINGDIAPI' - c++

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"

Related

ATL complains about not including Windows after VS2012 -> VS2017

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

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.

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

My program uses Qt and OpenGL. It compiles correctly under Linux and Mac.
When compiled on windows, I need to #include windows.h in order to use OpenGL, the code is like following,
#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
#include <windows.h>
#endif
#ifdef __APPLE__
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/glu.h>
#include <GL/glut.h>
#endif
However, there are a lot of error messages like
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2146: syntax error : missing ')' before identifier 'PRPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2165: 'left-side modifier' : cannot modify pointers to data
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2513: 'void *' : no variable declared before '='
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(167) : error C2440: 'initializing' : cannot convert from 'std::ostream' to 'void *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(168) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(226) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(226) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(226) : error C2491: 'I_RpcNegotiateTransferSyntax' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(227) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(235) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(235) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(235) : error C2491: 'I_RpcGetBuffer' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(236) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(242) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(242) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(242) : error C2491: 'I_RpcGetBufferWithObject' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(244) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(251) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(251) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(251) : error C2491: 'I_RpcSendReceive' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(252) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(259) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(259) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(259) : error C2491: 'I_RpcFreeBuffer' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(260) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(267) : error C2146: syntax error : missing ')' before identifier 'PRPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(267) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(267) : error C2491: 'I_RpcSend' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(268) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(275) : error C2146: syntax error : missing ')' before identifier 'PRPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(275) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(275) : error C2491: 'I_RpcReceive' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(277) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(284) : error C2146: syntax error : missing ')' before identifier 'RPC_MESSAGE'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(284) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(284) : error C2491: 'I_RpcFreePipeBuffer' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(285) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : error C2146: syntax error : missing ')' before identifier 'I_RPC_MUTEX'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : error C2182: 'I_RpcRequestMutex' : illegal use of type 'void'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(302) : error C2491: 'I_RpcRequestMutex' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(303) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(438) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(453) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(479) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(487) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(534) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(542) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(728) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(744) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(754) : error C2146: syntax error : missing ')' before identifier 'UUID'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(754) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(754) : error C2491: 'I_UuidCreate' : definition of dllimport data not allowed
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(755) : error C2059: syntax error : ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(763) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(771) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(779) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(838) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(848) : error C2061: syntax error : identifier 'cout'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(873) : error C2144: syntax error : 'unsigned long' should be preceded by ')'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(873) : error C2448: 'I_RpcConnectionInqSockBuffSize' : function-style initializer appears to be a function definition
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(874) : error C2144: syntax error : 'unsigned long' should be preceded by ';'
C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcdcep.h(874) : fatal error C1903: unable to recover from previous error(s); stopping compilation
If I don't #include windows.h, then those errors will not appear.
I am using VS2013 with Qt 5.3.
OpenGL on Microsoft Windows is tied to WGL, which is in turn tied to GDI.
As a result, you cannot #include <gl/gl.h> (you are indirectly doing this by including <GL/glu.h>) without first including some Windows-specific header that defines GDI/Windows pre-processor tokens such as WINGDIAPI and APIENTRY. But that is actually the extent to which any OpenGL program on Windows is tied to anything Windows-specific (header wise).
WinDef.h defines APIENTRY and WinGDI.h defines WINGDIAPI - including Windows.h brings in both of those headers (and a lot of other garbage unfortunately). So including Windows.h is mostly a convenience; to minimally compile OpenGL software on Windows you should #include <WinDef.h> followed by #include <WinGDI.h> and then finally #include <GL/gl.h>.
Alternatively, you can #define WIN32_LEAN_AND_MEAN just prior to #include <Windows.h> and it will significantly reduce the number of unrelated things that are brought in by including that header. Many Visual C++ projects actually define that pre-processor definition by default when they are first created, you might want to see if your project is configured that way.
windows.h clutter the global namespace with tons of bad things like ERROR, Rectangle ...
One way around the problem is to declare needed functions your self (I guess this is not too mutch work since you will not need more than 10 functions or so). You can call the include file wgl.h or something.
__declspec(dllimport) void* __stdcall wglCreateContext(void* hdc);
//... Other functions you need
The OpenGL API is defined outside windows.h so no problem there

Errors when including string (In C++)

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 :)

Syntax errors when trying to use CString in Visual C++

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)