[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.
Linker Error: GluPerspective
I'm getting an error with Dev-Cpp about GLUT. It says:
I have one parameter: -lopengl32
I thought that a multi-media project automatically did those for you?
I thought that a multi-media project automatically did those for you?
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.
-lglu32
The reason why the multimediatemplate does not include this is that this library isn't used in all OpenGLprojects.
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.
Now I have the linker error [Linker error] undefined reference to `auxDIBImageLoadA@4'. I don't understand these linker parameters..
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement