So I’m trying to compile source from this Beginning OpenGL Game Programming book using VC++ .NET 2003 and I’m getting some rediculous compiler errors
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\GL.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
Obviously there are errors within the opengl includes? If so, how and why? That’s really odd.
Another thing… I’ve searched the web for hours and have found OpenGL includes for the Windows platform at Microsoft’s site… They’re copyrighted from like 97 - 04… Is there any way I can get new(er) Open GL includes/headers/libs to work with (Windows)??? Also, are there any new files I need to be working with Open GL 2.0???
and yes i have included <windows.h> before the gl includes
I guess Dave have compiled these programs with VC++ 6.0. The examples of this book are so simple and don’t use from new extensions. However you can find new extensions here:
So if you have a VC++ 6.0 compiler, try to compile this program with VC++ 6.0 compiler.
However if you do not like to compile this program with VC++ 6 compiler, you should change the settings of this project to be compatible with VC++.net
Also take a look at the errata page of this book:
It seems that some samples produce syntax errors in some compilers.
Note that you had found an old header file. Remeber that OpenGL is a registered trademark of SGI.
I guess I should just go get an up to date Open GL book… wasn’t aware that this one was THAT old…
so you’re saying it’s out of date to use gl.h and glu.h and that everything you’d need is in that SGI Open GL SDK?
It’s on to you. If you are a beginner in game programming, it’s good to read this book. However if you have enough knowledge, you can start to read an advanced book like More OpenGL Game programming. More OpenGL Game Programmings explains new extensions, OpenGL shading language and other new topics.