Jump to content
  • Advertisement
Sign in to follow this  
orcfan32

Linker Error: GluPerspective

This topic is 4843 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'm getting an error with Dev-Cpp about GLUT. It says:
[Linker Error] undefined reference to 'GluPerspective@32'
[Build Error] [GLUT.exe] Error 1
Any idea why? I have all of the linker parameters and the code is from NeHe's Lesson 1.

Share this post


Link to post
Share on other sites
Advertisement
The gluPersective-function is in the glu32library so you have to add the reference so the linker finds the libfile. The parameter you have to add is:

-lglu32

The reason why the multimediatemplate does not include this is that this library isn't used in all OpenGLprojects.

Share this post


Link to post
Share on other sites
Just a comment, there is another library that you can find useful: glut32. It has functions to handle opengl windows, keyboard and mouse input and more. Take a look to it.

Share this post


Link to post
Share on other sites
Now I have the linker error [Linker error] undefined reference to `auxDIBImageLoadA@4'. I don't understand these linker parameters..

Share this post


Link to post
Share on other sites
The problem you're having is that the NeHe examples include some function calls that are precompiled into libs. The code for auxDIBImageLoad() as an example, is in the glaux.lib file. Just including the the header file glaux.h is not enough, since it only contains the function's prototype. You need the actual code that is executed when auxDIBImageLoad() is called. Hence, specifiying the library gives the compiler access to that code. I'd imagine another linker parameter of -lglaux will solve your problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!