Archived

This topic is now archived and is closed to further replies.

LenKol

OpenGL help starting OpenGL

Recommended Posts

i am learning openGl with the help of hawkins and Astle book (OpenGl Game Programming). However I ran into problems trying to compile the first *sight* code showing how to use wgl. I am using MS vc++6, and i have all the .h and .lib files in correct locations (i can compile most demos of the cd). When i try to compile the code these is what i get, please help

Linking...
mytest.obj : error LNK2001: unresolved external symbol _gluPerspective@32
mytest.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
mytest.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
mytest.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
mytest.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
mytest.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
mytest.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
mytest.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
mytest.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
mytest.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
mytest.obj : error LNK2001: unresolved external symbol __imp__glColor3f@12
mytest.obj : error LNK2001: unresolved external symbol __imp__glRotatef@16
mytest.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
mytest.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Debug/trythis.exe : fatal error LNK1120: 14 unresolved externals
Error executing link.exe.

 

Share this post


Link to post
Share on other sites
doh I didnt realise to link it

#pragma comment(lib, "opengl32.lib") // Link OpenGL32.lib
#pragma comment(lib, "glu32.lib") // Link Glu32.lib

i tied this and it works, although the book doesnt contain these two lines, unless i am going blind it wasnt even mentioned.
still a great book imo.

Share this post


Link to post
Share on other sites