Click to See Complete Forum and Search --> : GLUT troubles


jrap
09-20-2004, 08:25 PM
Hi all,

I'm experimenting with openGL for the first time, and have run into problems getting an example from my textbook to work.

I am running Slackware 10.0

I have
#include <GL/glut.h>
at the top of the source, but when I attempt to compile, I receive "undeclared (first use this function)" for all of the opengl functions.

I have been searching google, and have used various makefiles that people have provided, alas, no luck.

Any help would be much appretiated.

Thanks

capaci
09-20-2004, 10:07 PM
just to make sure, you have installed the glut files right? do you have glut.h in /usr/include/GL/ ?

bwkaz
09-21-2004, 06:55 PM
Try adding a:

#include <GL/glu.h>
#include <GL/gl.h>

after the glut.h include, just to be sure. glut.h should pull in those files, but it may not have.

Also try something like this:

compile-command 2>&1 | head -n 30 so that you don't get overwhelmed in undeclared function errors. This will print out only the first 30 lines of output from compile-command, so you can definitely see the first error.

In C programs, fixing the first error often fixes a lot of other ones. In this case, it wouldn't surprise me if the first error was "could not find GL/glut.h", and it just got lost in the noise...