Reputation: 2301
I'm trying to start learing opengl and I use VS2010 ultimate sp1 but when I add opengl headers I'm getting errors which indicate that there are errors in files not created by me.
#include "stdafx.h"
#include <Windows.h>
#include <gl\GL.h>
#include <gl\GLU.h>
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
errors (195 in total) this is I think the most common one:
Error 1 error C2008: '$' : unexpected in macro definition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\driverspecs.h 142
Upvotes: 0
Views: 1980
Reputation: 1877
Please check that you didn't disable Microsoft C++ extensions. $ as a part of identifiers is a part of these extensions, so driverspecs.h won't compile when they are disabled. Command line switch is /Za, also this option is the top-most in Language section in project properties in Visual Studio
Upvotes: 5
Reputation: 1281
My first guess would be windows.h stuff conflicting with opengl definitions. You don't really need windows.h for a simple command line application like this one. Another possibility is the precompiled headers option (stdafx.h) I usually disable it in the compiler options when I deal with OpenGL and other cross platform projects as dependencies they bring in usually don't agree well with ported code
Upvotes: 0