undefined reference to `glutBitmapCharacter'

Glut 3.6 is installed and I ran ldconfig too, but I get this:

/tmp/ccZMk6ER.o(.text+0x1105): undefined reference to glutBitmapTimesRoman10' /tmp/ccZMk6ER.o(.text+0x110a): undefined reference toglutBitmapCharacter’
collect2: ld returned exit status
make: *** [all] Error 1

I do have #include <GL/glut.h> in the code {at the top}
and the offending lines look like:

for (blah = 0; p2[blah]; blah = blah + 1)
glutBitmapCharacter(GLUT_BITMAP_NEW_TIMES_ROMAN_10, p2[blah]);

I’m running on linux {Slackware 8.1} 2.4.19
on athlon, w GeForce video.
Glut 3.6, Mesa 4.0.4 abd SDL-1.2.5 are all
installed can you please tell me what is up?

Hi !

No idea what the problem is but do notice that the error message is from ld (the linker) and not from gcc (the compiler).

I assume you have -lglut included so that you have the library linked in, make sure you don’t have more then one copy of libglut installed.


Doh… Damn Makefiles…
That was the problem {no -lglut}
That’s what I get for using someone elses code