Skip to main content
GameDev.net gamedev.net
🔒 Locked

Installing OpenGL

Started by Cribs Nov 1, 2005 at 1:19 AM 5 replies 2.6k views
Original Post
Cribs
Cribs
Hi, iv been working with DirectX and i now want to try out OpenGL and i cannot seem to get it to work. I have included the library files needed, and i ran a sample code from a tutorial and im getting errors in my gl.h file. c:\oglsdk\include\gl\gl.h(1151) : error C2144: syntax error : missing ';' before type 'void' c:\oglsdk\include\gl\gl.h(1151) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers c:\oglsdk\include\gl\gl.h(1151) : fatal error C1004: unexpected end of file found Line 1151 in gl.h is: WINGDIAPI void APIENTRY glAccum (GLenum op, GLfloat value); I have no clue what is wrong or where to start. It would be much appreciated if anyone could help. Regards, Cribs
Drew_Benton
Drew_Benton
Before you include your GL.H and GLU.H, you will need to have a:
#include
Undeadlnsanity
Undeadlnsanity
You need to include windows.h BEFORE gl.h is included. This will define WINGDIAPI and your troubles will be gone :-).
Cribs
Cribs
Thanks for the fast response.
Ok, now when i build it gives me 9 errors:

hello.obj : error LNK2001: unresolved external symbol _glutMainLoop@0
hello.obj : error LNK2001: unresolved external symbol _glutDisplayFunc@4
hello.obj : error LNK2001: unresolved external symbol _glutCreateWindow@4
hello.obj : error LNK2001: unresolved external symbol _glutInitWindowPosition@8
hello.obj : error LNK2001: unresolved external symbol _glutInitWindowSize@8
hello.obj : error LNK2001: unresolved external symbol _glutInitDisplayMode@4
hello.obj : error LNK2001: unresolved external symbol _glutInit@8

Dont i need /NODEFAULT or something like that?
Grain
Grain
Did you link to the glut32.lib ?
circuit
circuit
Quote:
Original post by Cribs
Thanks for the fast response.
Ok, now when i build it gives me 9 errors:

hello.obj : error LNK2001: unresolved external symbol _glutMainLoop@0
hello.obj : error LNK2001: unresolved external symbol _glutDisplayFunc@4
hello.obj : error LNK2001: unresolved external symbol _glutCreateWindow@4
hello.obj : error LNK2001: unresolved external symbol _glutInitWindowPosition@8
hello.obj : error LNK2001: unresolved external symbol _glutInitWindowSize@8
hello.obj : error LNK2001: unresolved external symbol _glutInitDisplayMode@4
hello.obj : error LNK2001: unresolved external symbol _glutInit@8

Dont i need /NODEFAULT or something like that?


If you are using external libraries such as GLUT you need to download them and link with them.

I think GLUT is available here: http://www.xmission.com/~nate/glut.html


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.