glutBitmapString undefined

Hi everyone.
I read that function glutBitmapString(font, string) write a string on screen.

If I try to use this function I have an undefined compile error. I include glut and opengl headers and I use Xcode 4

In general to resolve build problems it is helpful if you post the complete error message you get.

Undefined symbols are reported by the linker (not the compiler) and inform you that none of the object files (.o generated by the compiler from the corresponding .c/.cpp) or libraries that you are linking contain a symbol of the given name.
It sounds like you are not linking the glut library.

I don’t know exactly how to do this in Xcode, but there should be a dialog where you can configure the libraries to link with - possibly under something like project properties/dependencies or some such.

He seems to link with glut.

Cf this topic: http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=307239#Post307239

So it might be something else, like using glut headers from one version and glut library from another version. Try to check if you use both headers and libraries from the same version (glut, freeglut or so) but don’t mix them.