I cant compile X11+OpenGL+gcc+linux

I am new to linux(mandrake9), and i need to get a opengl+x11 sample running on my system.

If i try to compile a NeHe glx sample app…

gcc -Wall -pedantic -ansi lesson03.c -o lesson03 -L/usr/X11R6/lib -lGL -lGLU -lX
lesson03.c:14:20: GL/glx.h: No such file or directory
lesson03.c:15:19: GL/gl.h: No such file or directory
lesson03.c:16:20: GL/glu.h: No such file or directory
lesson03.c:17:38: X11/extensions/xf86vmode.h: No such file or directory
lesson03.c:18:24: X11/keysym.h: No such file or directory


Gcc can’t find the header files.Try this:
gcc -Wall -pedantic -ansi -I/usr/X11R6/include -I/usr/X11R6/include/GL lesson03.c -o lesson03 -L/usr/X11R6/lib -lGL -lGLU -lXxf86vm

[This message has been edited by zen (edited 02-14-2003).]

I still get the same error.
I do not have \include\GL that has to be the problem.How do i get that, or extraxt it.

How is it possible that this mandrake 9 install doesnt have gl headers.

im on linux day 2,so sorry for the newb questions,


first of all do a:
locate gl.h
or a:
find /usr -name “gl.h”

If you come up with nothing then you don’t have x11 libraries development package installed.Find it and install it.

If you dont have /usr/include/GL you probly dont have OpenGL. What you need to do is goto mesa3d.sourceforge.net and download and isntall that. You should/need to compile from source and install since it needs to compile for your kernel, this means you have to have your kernel source installed it probly is. Check to see if your video card company makes linux drivers cuz those are made for your card, I know nvidia does(im running them) and ive heard ATI does as well.

Just in case, you’re probably using the wrong path delimiter; that should be /, not .

I’m getting tired of this.All right here we go again:Mesa got integrated into X from version 4 upwards through the DRI.The Mesa you’re reffering to , nukem, is he software implementation.Do not install that.Instead install the X11 deveopment libs or whatever package has the DRI development stuff in your distro.The only reason it probably works for you is that you have the xlibs installed(which installs the correct libgl.so) and the mesa sources just provide the headers.

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