bigdufstuff
January 8th, 2006, 10:37 PM
I am following a tutorial for OpenGL on Linux found here
http://mercury.chem.pitt.edu/~sasha/LinuxFocus/English/January1998/article16.html
I am trying to get this simple example to compile
#include <GL/glut.h>
int main(int argcp, char **argv) {
/* Set window size and location */
glutInit(&argcp, argv);
glutInitWindowSize(640, 480);
glutInitWindowPosition(0, 0);
/* Select type of Display mode:
single buffer & RGBA color */
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE);
/*Initialize GLUT state */
glutCreateWindow("Hello World");
glutMainLoop();
return 0;
}
gcc barfs with this
$ gcc glexample.c
/tmp/ccoHHIVb.o: In function `main':
glexample.c:(.text+0x27): undefined reference to `glutInit'
glexample.c:(.text+0x3c): undefined reference to `glutInitWindowSize'
glexample.c:(.text+0x4b): undefined reference to `glutInitWindowPosition'
glexample.c:(.text+0x58): undefined reference to `glutInitDisplayMode'
glexample.c:(.text+0x68): undefined reference to `glutCreateWindow'
glexample.c:(.text+0x70): undefined reference to `glutMainLoop'
collect2: ld returned 1 exit status
Am I missing a GLUT package? or is there something wrong with the code? I can't tell.
I installed the following glut packages
freeglut3-dev
glutg3-dev
libglut3-dev
on top of this I also installed the mesa development package.
Any idea why it won't compile? thanks.
http://mercury.chem.pitt.edu/~sasha/LinuxFocus/English/January1998/article16.html
I am trying to get this simple example to compile
#include <GL/glut.h>
int main(int argcp, char **argv) {
/* Set window size and location */
glutInit(&argcp, argv);
glutInitWindowSize(640, 480);
glutInitWindowPosition(0, 0);
/* Select type of Display mode:
single buffer & RGBA color */
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE);
/*Initialize GLUT state */
glutCreateWindow("Hello World");
glutMainLoop();
return 0;
}
gcc barfs with this
$ gcc glexample.c
/tmp/ccoHHIVb.o: In function `main':
glexample.c:(.text+0x27): undefined reference to `glutInit'
glexample.c:(.text+0x3c): undefined reference to `glutInitWindowSize'
glexample.c:(.text+0x4b): undefined reference to `glutInitWindowPosition'
glexample.c:(.text+0x58): undefined reference to `glutInitDisplayMode'
glexample.c:(.text+0x68): undefined reference to `glutCreateWindow'
glexample.c:(.text+0x70): undefined reference to `glutMainLoop'
collect2: ld returned 1 exit status
Am I missing a GLUT package? or is there something wrong with the code? I can't tell.
I installed the following glut packages
freeglut3-dev
glutg3-dev
libglut3-dev
on top of this I also installed the mesa development package.
Any idea why it won't compile? thanks.