linkin problem?

Started by
7 comments, last by chowe6685 19 years, 6 months ago
I copied the code for nehe first tutorial, just the basic windows and that run fine but when i copy that file to start a new workspace, i get these linking errors: main 2.obj : error LNK2001: unresolved external symbol _gluPerspective@32 main 2.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0 main 2.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4 main 2.obj : error LNK2001: unresolved external symbol __imp__glViewport@16 main 2.obj : error LNK2001: unresolved external symbol __imp__glHint@8 main 2.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4 main 2.obj : error LNK2001: unresolved external symbol __imp__glEnable@4 main 2.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8 main 2.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16 main 2.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4 main 2.obj : error LNK2001: unresolved external symbol __imp__glClear@4 main 2.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4 main 2.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8 main 2.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4 Debug/chapter 2.exe : fatal error LNK1120: 14 unresolved externals Error executing link.exe. what is the problem here? thanks.
Advertisement
You need to link with the OpenGL lib, which is OpenGL32.lib IIRC.
He also needs to link to glu32.lib

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

thanks, i totally forgot about that.
how to link?
Best Regards,from psjie
how to link with the lib?
Best Regards,from psjie
i got the openGL.lib and glu32.lib in my vc\lib folder. but still got this error. how to solve???
Best Regards,from psjie
Using what compiler/IDE? In MSVC6, you can go to Project->Settings->Link (tab), and add them there.
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")

This topic is closed to new replies.

Advertisement