GL/gl.h :no directory or file

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.

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.

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.

In that case add -I/usr/X11R6/include to your command line to GCC.

Cheers.

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.

Originally posted by caophong:
[b]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.[/b]

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

Originally posted by caophong:
[b]hi,

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

I said “add”, not “replace -L by -I”.

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

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.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.