I have upgraded my Dell M60 to one with the latest NVIDIA card and have attempted to recompile some flight simulation code, but it fails. The M60 has the latest NVIDIA driver and I believe I have installed all the right glut libraries etc… Here is the error and Google has similar errors but no obvious soulition:
[root@pal-b5c449w1 detailFiles]# make
g++ -o teapotdetail flightdetail12.o landdetail10.o comm001.o texture.o constants.o comm_variables.o -L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lGL -lGLU -lglut -lm -lX11 -lXext
/usr/lib/libglut.a(glut_cmap.o)(.text+0x479): In function
__glutSetupColormap':: undefined reference toXmuLookupStandardColormap’
collect2: ld returned 1 exit status
make: *** [teapotdetail] Error 1
i think you have to add the compiler flag
how do i get this idea? “undefined reference” is a linker error, not a compiler error. this means you did include the right files, but you did not tell g++(or gcc) which libraries to use.
if your compiler tells you that a function “Xmu…” is missing, you should look for a library libXmu*, if there’s a function “X11…” missing, the missing library is most probably libX11*
but you don’t have to guess: in my system i find a library “/usr/X11R6/lib/libXmu.so”. entering in a terminal window
readelf -s /usr/X11R6/lib/libXmu.so
lists all functions in that library. to complete this,
readelf -s /usr/X11R6/lib/libXmu.so | grep XmuLookup
shows you that the routine that you need is really included in that library.
Thank you. That fixed the compilation! That was the good news. The bad news is that I now get a segmentation error on the GlInit initial call.
I wonder if I need to reinstall all the GLUT files etc. This new machine has been a nightmare. Is there a listing anywhere of what rpms are needed to make Fedora 2 run?
what is glinit? can you post some code?
I have to say this: If there is any way you can
avoid using glut and write the routines that you
need by yourself, do that.
Not only will it solve your problems, it will give
you ultra-valuable experience in coding the main
loop, etc. Anything serious should be done either
from scratch, or using something more advanced than
glut, like SDL. In my understanding about glut – as
I have repeated in this forum – is that glut is
meant to provide all the routines you need to learn,
but it is not meant to be a permanent part of any