From http://bugs.gentoo.org/show_bug.cgi?id=79693#c5 there is an incompatibility between the glext.h in nvidia-glx and the glext.h in gtkglext. Because the glext.h in gtkglext is derived from the SGI OpenGL 1.2.1 sample implementation it is more apt to be correct; also examination of the #ifdefs suggest that gtkglext has got it right. This means that any program using gdkglglext.h will fail: $ echo '#include <gdk/gdkglglext.h>' >foo.c; gcc $(pkg-config --cflags gtkglext-1.0) foo.c In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53, from foo.c:1: /usr/include/gtkglext-1.0/gdk/glext/glext.h:1540:1: warning: "GL_RESTART_SUN" redefined In file included from /usr/X11R6/include/GL/gl.h:71, from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:33, from foo.c:1: /usr/X11R6/include/GL/glext.h:2215:1: warning: this is the location of the previous definition In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53, from foo.c:1: /usr/include/gtkglext-1.0/gdk/glext/glext.h:1541:1: warning: "GL_REPLACE_MIDDLE_SUN" redefined In file included from /usr/X11R6/include/GL/gl.h:71, from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:33, from foo.c:1: /usr/X11R6/include/GL/glext.h:2216:1: warning: this is the location of the previous definition In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53, from foo.c:1: /usr/include/gtkglext-1.0/gdk/glext/glext.h:1542:1: warning: "GL_REPLACE_OLDEST_SUN" redefined In file included from /usr/X11R6/include/GL/gl.h:71, from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:33, from foo.c:1: /usr/X11R6/include/GL/glext.h:2217:1: warning: this is the location of the previous definition In file included from /usr/include/gtkglext-1.0/gdk/gdkglglext.h:53, from foo.c:1: /usr/include/gtkglext-1.0/gdk/glext/glext.h:3810: error: redefinition of typedef 'PFNGLCOLORSUBTABLEEXTPROC' /usr/X11R6/include/GL/glext.h:3223: error: previous declaration of 'PFNGLCOLORSUBTABLEEXTPROC' was here The nvidia glext.h has: #ifndef GL_EXT_paletted_texture #define GL_EXT_paletted_texture 1 #ifdef GL_GLEXT_PROTOTYPES extern void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); extern void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); extern void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); extern void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); extern void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (APIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); typedef void (APIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); #endif By comparison with the gtkglext glext.h it is clear that the defines and typedefs regarding subtables should go in an #ifndef GL_EXT_color_subtable section. The patch I will attach will accomplish this, causing the nvidia and gtkglext glext.h to become compatible.
Created attachment 50149 [details, diff] NVIDIA_glx-1.0.6629-defines2.patch This is the same patch as attached to bug 79693. It is quite short and can probably be merged into the existing NVIDIA_glx-1.0.6629-defines.patch in the nvidia-glx ebuild. To reiterate: it is the nvidia-glx glext.h that is broken and needs patching to prevent it breaking programs that use gdkglglext.h from gtkglext.
Does it compile fine if you use the glext.h from opengl-update-2.1.1 (you will need to manually set the symlink in /usr/include/GL)?
Sorry, hit bug 81385. Yes, it works with /usr/lib/opengl/global/include/glext.h.
actually, I'm sorry you hit bug 81385... but I digress... I think this patch can go into nvidia-glx, but in the future maybe opengl-update should use the global files rather than the ones provided by the package unless '--override-headers' is used or something similar... I'll get to this soon. Thanks.
opengl-update now uses the global headers instead.