I installed mesa 2.6 in my linux 5.2, the headers files are in
/usr/include/GL/* (including gl.h, glu.h, glut.h, etc)
but when I am making a sample program to test GL, using the command
gcc a.c
the compiler says:
/tmp/cca002661.0:In function ‘main’
/tmp/cca002661.0 (.text+0xc); undefined reference to ‘glutInit’).
/tmp… (same thing repeated) (whatever glut func.
.
.
.
what is the problem? what can I do?
From Alan.
Where abouts are the GL LIB’s ?, or whatever the linux equivalent is? I usually get that error when a compiled function cannot be found, sorta like not linking opengl32.lib when making a win32 openGL app.
Sorry if you’ve already checked for this, but some answers are so simple its easy to just overlook them
> ./hello: error in loading shared libraries: libGL.so.1 cannot open shared
> object file: No such file or directory
this means that it can’t find the library at execution time.
That’s controled by /etc/ld.so.conf. You need to add the location of the
libGL.so.1 to that list and run ldconfig. I always delete /etc/ld.so.cache
before I run ldconfig, but I’m pretty sure that’s not necessary.
I solved my problem earlier, but using not good way.
I code my program in the demos directory, add the simbol in that directory’s makefile.
then “make linux”. the makefile there will help you to use the approprieate command to compile. and it works!
but I took at look at the makefils and make-config, there are so many options for compiling, even only in linux. can anyone help me to point out which one is useful and which one is not? what shall I do? copy the exactly makefile to my own directory, or what else?
thankx.
From Alan.