Jump to content
  • Advertisement

Archived

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

LenKol

OpenGL help starting OpenGL

This topic is 5966 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!