PDA

View Full Version : GL/gl.h :no directory or file



caophong
04-18-2001, 10:10 AM
hi,

i can't seem to compile my program under linux mandrake 7.0

gcc -o -L/usr/X11R6/lib -lGL -lGLU file.c

it says:

GL/gl.h : No directory or file found
GL/glu.h : No directory or file found

so how do i now if i have these file intall? if i do not have it, which *.rpm i need to intall from Mandrake linux 7.0?

thank you.

rts
04-18-2001, 11:03 AM
To see if the file is installed or not, try:

locate gl.h


If nothing comes back, you need to install XFree86-devel and Mesa-common-devel

Hope this helps.

caophong
04-18-2001, 12:19 PM
hi i did locate gl.h and nothing comes back. so i reinstall XFree86-devel and Mesa-common-devel and it still says the same thing. GL/gl.h ad GL/glu.h : no suck directory or file.

manually i found the file gl.h and glu.h at /usr/X11R6/include/GL/ so why isn't it finding those files? do i need to specify something in the PATH? thanks.

rts
04-18-2001, 12:27 PM
In that case add -I/usr/X11R6/include to your command line to GCC.

Cheers.

caophong
04-18-2001, 05:25 PM
hi,

ok. now when i type gcc -o -I/usr/X11R6/include/ -lGL -lGLU -lglut file.c it gave me the following error message:

/usr/bin/ld : cannot find -lGL
collect2: ld return exit status

so how do i fix this? thanks.

idiot
04-20-2001, 10:30 AM
Originally posted by caophong:
hi,

ok. now when i type gcc -o -I/usr/X11R6/include/ -lGL -lGLU -lglut file.c it gave me the following error message:

/usr/bin/ld : cannot find -lGL
collect2: ld return exit status

so how do i fix this? thanks.

um...did you remove the -L... path that you had in your above post? and if you didn't, then locate where libGL<bla>.so/a libraries are and just give gcc -Lpathname to it...
or you might want to make a sym link to the gl directories from the well known include/lib directories.

good luck

rts
04-20-2001, 11:02 AM
Originally posted by caophong:
hi,

ok. now when i type gcc -o -I/usr/X11R6/include/ -lGL -lGLU -lglut file.c

I said "add", not "replace -L by -I".

gcc -o myprogram -I/usr/X11R6/include/ file.c -L/usr/X11R6/include -lGL -lGLU -lglut.

caophong
04-20-2001, 05:02 PM
wooohoooo it works thank you. just have to change


gcc -o myprogram -I/usr/X11R6/include/ file.c -L/usr/X11R6/lib -lGL -lGLU -lglut.