# OpenGL compilation problems

This topic is 4928 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm having trouble compiling Sh (a shading language) on linux. I'm posting here because I think the problem most likely lies with something gcc is doing. I'm getting the following error:
GlTextureStorage.cpp:86: error: glTexImage3D' undeclared (first use this
function)
GlTextureStorage.cpp includes GlTextureStorage.hpp which includes GlBackend.hpp; the code in GlBackend.hpp contains the following:
#define GL_GLEXT_VERBOSE 1
#define GL_GLEXT_PROTOTYPES 1
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glx.h>

This looks correct to me. Also GL/glext.h looks correct, it comes from (as best I can tell) nvidia's 6111 driver release and contains glTexImage3D within an #ifdef GL_GLEXT_PROTOTYPES (which appears to be satisfied above). I am using gcc 3.3.3 (in case that is of any use). If anyone can shed some light on this it would be most appreciated.

##### Share on other sites
I haven't checked NVidia's headers, but my glext.h only defines glTexImage3D if the OpenGL version is less than 1.2 (because, if the implementation is greater than or equal to 1.2, glTexImage3D should already be provided). You might want to check to make sure your gl.h header is providing glTexImage3D if it's claiming to be OpenGL 1.2 or newer. I not sure how well NVidia's glext.h plays along with Mesa's gl.h or vice versa.

##### Share on other sites
Yes, this would be a problem.

gl.h defines GL_VERSION_1_2 and glext.h has an ifndef around the glTexImage3D block. So that would explain that problem. Unfortunately, it does not provide the prototype.

The situation is this:
lrwxrwxrwx    1 root     root           35 Aug 18 00:03 gl.h -> /usr/lib/opengl/nvidia/include/gl.hlrwxrwxrwx    1 root     root           38 Aug 18 00:03 glext.h -> /usr/lib/opengl/global/include/glext.h`

gl.h appears to be nvidia's, and glext.h appears to be general. I'm guessing nvidia's headers are at fault, any ideas?

I found this link, to a gl.h file from nvidia which has a glTexImage3D prototype, but it looks old (last modified Feb 2003), and 6111 is a pretty recent release, I have no idea what's going on with these headers.

##### Share on other sites
I was pretty sure nvidia provided a glext.h file along with their gl.h, etc. Perhaps you can just use that instead? If it's not in the usual include location, then it should be in /usr/share/doc/NVIDIA-1.0/include/GL/ Of course, I may be totally off about nvidia providing a glext.h, but look into it at least.

##### Share on other sites
run the detonator's intallation program with --extract-only as argument. then look in ./NVIDIA-Linux-x86-1.0-version-package/usr/include/GL. You should have the glext.h there.

##### Share on other sites
Well, I've been using Gentoo so I used the opengl-update utility for changing GL drivers. NVidia does provide OpenGL headers with their drivers so I tried removing the symlinks and just dumping in the GL headers. This worked well enough.

I still wanted to get opengl-update working properly so I looked into it a bit more. The gl.h header in 5336 defined glTexImage3D (and other funcs) and defined GL_VERSION_1_1 ... GL_VERSION_1_4. The gl.h header in 6106 and 6111 does not have glTexImage3D, but it only defines GL_VERSION_1_1 leaving glext.h to handle the glTexImage3D prototype. My best guess is that I was using an older opengl-update and it may have left some junk around defining GL_VERSION_1_2 which was messing things up.

I think this is Gentoo specific so I doubt anyone else has to worry about it. I'm posting the update just in case. It also seemed to happen only under specfic circumstances, with newer opengl-update versions it seems to work correctly.

Thanks

##### Share on other sites
See this forum post (towards the end, when Andy Ritger from nvidia posts) for some info about the change between 5336 and 6106.

##### Share on other sites
Quote:
 Original post by Mr GrinchSee this forum post (towards the end, when Andy Ritger from nvidia posts) for some info about the change between 5336 and 6106.

That would seem to explain it. I also thought I ran into trouble with 6111 -- but that might just be standard user error stuff. [smile]

Thanks for the info.