PDA

View Full Version : glu.h help needed!



07-29-2002, 06:05 PM
Hi,

I recently upgraded my machine to mandrake 8.2, and I have finally got back to looking at opengl stuff. Anyways, after installing the nvidia header files, nothing that includes glu.h will compile! I get syntax
errors in glu.h, as follows:

make
gcc -Wall -ansi lesson11.c -o lesson11 -L/usr/X11R6/lib -lGL -lGLU -lm `sdl-config --cflags --libs`
In file included from lesson11.c:17:
/usr/include/GL/glu.h:263: parse error before `*'
/usr/include/GL/glu.h:265: syntax error before `void'
/usr/include/GL/glu.h:265: warning: data definition has no type or storage class/usr/include/GL/glu.h:266: syntax error before `void'


(above is nehe lesson 11 SDL version).

the error relates to two #define's that
are missing from the file, GLAPIENTRY and
GLAPI, which seem to be defined in gl.h
in the mesa version of the file, but not in the nvidia version of gl.h

anyone else run into a problem like this? I
tried cheating and adding those defines to glu.h directly, but I am sure that is not the right solution is it????

any help appreciated, thanks.

jide
07-30-2002, 07:55 AM
you may use glut ??? so add -lglut and all for X ( -lXext...)

07-31-2002, 03:23 PM
Originally posted by jide:
you may use glut ??? so add -lglut and all for X ( -lXext...)

That doesn't explain why I get syntax errors from glu.h

amendol
07-31-2002, 07:28 PM
I have come across this exact problem.
For some reason (I can't remember exactly what it was) Mesa's glu was not working correctly. So I downloaded glu from sgi. Do a search on glu / sgi, and you will find an rpm to install. -- I believe that I found it on the Mesa site.

Note: glu is only a utility library, nothing in it is hardware accelerated, so you don't have to worry about hardware compat.

Mesa --glut-- works fine so keep it, it is also just software - so there will be no driver problems.

Mesa --gl-- must not be installed to get the NVidia hardware working.

So, here it is, you need:
-the gl librarys/headers from NVidia
-the glu librarys/headers from sgi
-the glut librarys/headers from Mesa

This is my workaround:
* I installed the NVidia drivers and made sure that they were working + there were no Mesa packages installed.

* I installed the Mesa glut librarys with the --nodeps argument (the rpm dependency requires Mesa gl to be installed):
this is called libMesaGlut3, and libMesaGlut3devel in Mandrake.

* I installed sgi's glu like so:
rpm -i oss-opengl-glu-20000925-1.i386.rpm

* I replaced the gl system header files (found in /usr/X11R6/include/GL) with the headers found in the NVidia directorys, (/usr/share/doc/NVIDIA_GLX-1.0/NVIDIA-GL-includes/)

That's it. Now all my software using opengl/glut/glu compiles and works

Jamie

08-03-2002, 10:07 AM
Thanks man! That solved my problem exactly.

31337
08-09-2002, 06:21 PM
This is my first post in this forumn, weeee!

Just wanted to make a correction to your workaround I have noticed. I ran into the same problem so I tried your solution. It seemed to work except for one thing. There was no libMesaglut3devel. The correct name (for those of you going to rpmfind.net) is libMesaglut3-devel This I believe contains the glut.h files and is nessecary to compile your glut programs http://www.opengl.org/discussion_boards/ubb/smile.gif

Besides that great job dude that helped a lot

marcus256
08-14-2002, 03:39 AM
Of course, the simplest soulution is to use the gl.h & glu.h includes from here (http://hem.passagen.se/opengl/getstarted/) (click on "GL Includes" to the left), and instead of using GLUT, use GLFW (http://hem.passagen.se/opengl/glfw/) .