Hi all!
I’m new to OpenGL programming but I have a problem. I have to modify an existing project that makes use of OpenGL library. I had some problem trying to find the glut libriry, but I mahaged to and I compiled the project. Now when I try to execute the program it says that it can’t find the symbol glDisable. How is it possible? Why doesn’t it finds thelibrary? The compiler and the linker did, otherwise they would’nt compile or link…
Any Idea?
I think you’re perhaps a touch confused. You don’t get run-time exceptions like “can’t find glDisable”; this is a compiler error and means you forgot to include “gl.h” and/or forgot to link with opengl32.lib.
The exception to this might be some sort of C# framework that loads the core procs from opengl32.dll. In that case make sure the framework has been installed properly, and that your project has likewise been configured correctly.
I’m sure I get this error at runtime! As I said, it compiled and linked well, I added the glut.h file and the glut library to the linker arguments. As you may have noticed, I’m programming under Linux, so it’s not a C#`problem for sure! Thank for the help anyway! Any other ideas?
that’s ok, because glDisable should be in libGL, not in libglut. if you type the readelf command without grep, you’ll see all functions and symbols defined in the lib.
it seems that your executable is not linked with libGL or libGLU at all. that seems a bit strange to me. how do you compile? i think it should look like
Wel, there aren’t those flgs, but I got this project from someone else, and I worked withou those. Anyway if I add them I get an error, saying it can’t find -lGLU…
still strange. you need libGL to run a glut program, so you have to set the according compiler flag.
“can’t find lGLU” could mean that libGLU is not installed, or that the compiler just doesn’t find it.
to check if the libs are installed, you could just search in the default library paths (/usr/lib, /usr/X11R6/lib etc.), or if you have a prog installed that uses opengl, run ldd on that program.
if the libs are present somewhere, you can
a) copy them to the default library directory where the other libs are and run ldconfig afterwards
or
b) set the compiler flag -L to tell gcc where to look for the lib:
Now it seems it compiles with the -lGLU flag, but when I run the program it says again that it can’t find the library… It’s a very strange problem IMHO, since when I compile and link there isn’t any error message, only when I run…
Where CC is Gcc and cflag is only a flag for optimization…
This morning I deleted every gl* and GL* library I had and reinstalled all. Everything worked fine. But then I unistalled my program and installled again and I get that damn error again. I show you the install script too: