glutBitmapCharacter() ??


I am reading the green book and it mentions glutBitmapCharacter() as a nice function to display text. Unfortunitly I cannot get it to work/compile. Is there someone who knows what headder files I need and where to get them?? I did include glut.h into my code, but I am getting an undefined symbol error in my .o files on glutBitmap9by15 and glutBitmapCharacter.

I am working on a Sun workstation running solaris.
Heres my code:

#include “glut.h”
#include “GL/glu.h”
#include “GL/glx.h”

glRasterPos3f(0.0, 0.0, 0.0);
char string[ ] = “Hello!”;
for (int i = 0; string[i] != ‘\0’; i ++)
glutBitmapCharacter(GLUT_BITMAP_9_BY_15, string[i]);

There must be something I am missing (quite possibly my brain) but any help would be appreciated!!!


glut.h should be placed in the same directory as gl.h ans glu.h, but this is no requirement. So you should include it as #include <GL/glut.h>.

Anyways, this is probably not the problem, since it’s a linker error. You need to add the GLUT library to your commandline. Dunno exactly how it is, but it’s the same as with the GL library. -l<libname> I think.