-
Compiling with gcc
Hello, I am trying to compile the first sample program from the redbook. Located in the programming guide link.
It has these 2 include statements.
#include <GL/gl.h>
#include <GL/glut.h>
I try to compile with this command: (Note I am using slackware 10.1)
gcc -lGLUT -lGL -o sample sample.c
Is anything wrong with this?
I get this error:
/usr/lib/gcc-lib/i486-slackware-linux/3.3.4/../../../../i486-slackware-linux/bin/ld: cannot find -lGLUT
collect2: ld returned 1 exit status
I have GLUT 3.7. Infact it comes with slackware 10.1. How nice! But I dont know how to use it yet.
Any help would be appreciated.
Beezer
-
Junior Member
Newbie
Re: Compiling with gcc
you have to specify a "library path", look where is libglut.so on your system [I put my one into /usr/local/lib ] and supply the library path to gcc:
in my case: gcc mycrap.c -L/usr/local/lib -L/some/other/lib/path -lglut -lother
and be careful about case-sensitivity: libGLUT, libglut, libGlut are three different names!
-
Re: Compiling with gcc
In fact the good command is :
gcc arbfplight.c -o arbfplight -L/usr/X11R6/lib/ -lGL -lGLU -lglut
-
Re: Compiling with gcc
Be careful ! GLUT is not the same thing as glut.
-
Re: Compiling with gcc
I try "gcc hello.c -o hello -L/usr/X11R6/lib/ -lGL -lGLU -lglut", all good, realy work ! (I work in Slackware)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules