tags:

views:

31

answers:

3

Hello, I'm working on windows XP with Visual C++ 2008 Express Eition. Im trying to include:

#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>

and getting alot of errors like:

1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'
1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
1>c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'

etc.

My question is: can i use those includes or do i need to get those libraries from somewhere at first? Thanks.

A: 

You are probably trying to compile it as C++ instead of C, or something along those lines.

leppie
A: 

Why are you using SDKs named 'v6.0a' with VC++2K8? Are you sure that's the latest OpenGL headers you have? You should be using latest Platform SDK and OpenGL headers whenever possible.

jv42
+3  A: 

For reasons known to Microsoft only, the OpenGL headers provided with the various Windows SDKs require that you

#include <windows.h>

before.

Bahbar