Archived

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

GL App, Linker Errors

This topic is 5147 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 recently just went through and reformatted and arranged some gl basecode from nehe and apparantly i made some huuge error. I get linker errors out the ass for my gl functions. I have about 14 of these type of linker errors: BaseGL error LNK2019: unresolved external symbol __imp__glLoadIdentity@0 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z) Ive got a working build but i cant seem to find what i changed to fug everything all up. Any ides?

Share this post


Link to post
Share on other sites
just add
#pragma comment(lib,"opengl32.lib")
at the begining of your main source file
or, if you are using msvc, add opengl32.lib to the libraries in the project properties

you might also need glu32.lib and glut32.lib

hope that helps

matt


[edited by - lemurion on November 13, 2003 3:12:47 PM]

Share this post


Link to post
Share on other sites
Looks like you're not linking to the OpenGL library. If you're using VC++ you need to add it to the list of library dependencies or add #pragma comment("lib, "OpenGL32.lib") to the code.

EDIT: oops too slow.

[edited by - dcosborn on November 13, 2003 3:13:45 PM]

Share this post


Link to post
Share on other sites
Cool, thanks guys. That fixed the prob.

Just wierd though as ive been compiling and running OpenGL code for a long time and never had to manually link the libs like that. Im running .NET ''03 btw.

thanks again

Share this post


Link to post
Share on other sites