If you are using glut then download the GLUT.3.7.6+ package. Then to compile that code the easiest thing to do is go to FILE->NEW->PROJECT then click the MultiMedia tab and select glut, which should appear if you installed it properly. Also, once you do that go to PROJECT->PROJECT OPTIONS then click the parameters tab and make sure that the following is entered in the linker box “-lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32”.
If your not using Dev-C++ then state which compiler you’re using and someone can help you, although it should be similar to my explanation above.
/home/jorge/tmp/cc0jjEHK.o: In function `main':
igraph.c:(.text+0x27): undefined reference to `glutInit'
igraph.c:(.text+0x34): undefined reference to `glutInitDisplayMode'
igraph.c:(.text+0x49): undefined reference to `glutInitWindowSize'
igraph.c:(.text+0x58): undefined reference to `glutInitWindowPosition'
igraph.c:(.text+0x68): undefined reference to `glutCreateWindow'
igraph.c:(.text+0x7d): undefined reference to `glutDisplayFunc'
igraph.c:(.text+0x8d): undefined reference to `glutKeyboardFunc'
igraph.c:(.text+0x95): undefined reference to `glutMainLoop'
/home/jorge/tmp/cc0jjEHK.o: In function `init':
igraph.c:(.text+0xbf): undefined reference to `glClearColor'
igraph.c:(.text+0xcf): undefined reference to `glMatrixMode'
igraph.c:(.text+0x107): undefined reference to `gluOrtho2D'
/home/jorge/tmp/cc0jjEHK.o: In function `display':
igraph.c:(.text+0x11f): undefined reference to `glClear'
igraph.c:(.text+0x13c): undefined reference to `glColor3f'
igraph.c:(.text+0x149): undefined reference to `glBegin'
igraph.c:(.text+0x161): undefined reference to `glVertex2i'
igraph.c:(.text+0x169): undefined reference to `glEnd'
igraph.c:(.text+0x16e): undefined reference to `glFlush'
collect2: ld returned 1 exit status
In Mandriva Control Center or Smart Package manager which ever you prefer install libMesaglut3 and the devel library for it. In my experience this still didn’t work for me (I honestly have no idea why, it installs the correct library and header files yet still fails for me on Mandriva 2006 x64).
I did however find anything to do with glut started working as soon as I compiled and installed freeglut.
I thought it’s “-lGLU” not “-GLU”. In any case, I have tried compiling his code myself it just doesn’t seem to want to work (that includes compiling against thac’s xorg that comes with Mesa 6.4.1 instead of Mandriva’s 5.0.2).
Without providing “-lglut -lGL -lGLU” you get same problem as mentioned here for obvious reasons, however when you provide them it is unable to find any of the libraries ("/usr/bin/ld: cannot find -lGL"). I honestly don’t understand it.
I personally gave in and started messing with OpenGL in Qt instead and pretty much everything I do works fine there. The coding provided converted to Qt would work no problem at all. The only other option I would have had would be to continue using freeglut.