error LNK2001

i am novice to Open GL.i just got code from a web site, understood it, when i compile it , no errors are there, but when i try to execute the code its giving “error LNK2001 " , like its giving messages " unresolved external symbol _gluPerspective@32” …


I guess you mean you get this error after compilation, when you link it, it means that you have missed to include the opengl32.lib import library in your link “command” or what ever you do to compile your application. What compiler are you using ?



I think that you have missed to include the “glu32.lib”

If you use MS VC, for me, you have 2 method for include this file :

in the code, type :

#pragma comment (lib,“glu32.lib”)

or, press Alt + F7 and add “glu32.lib” in the link options.

Sorry about that, of course it’s glu32.lib, I guess I was sleeping or something.