Summary: | /usr/include/GL/glxext.h:480:143: error: 'GLintptr' has not been declared | ||
---|---|---|---|
Product: | Mesa | Reporter: | Orion Poplawski <orion> |
Component: | GLX | Assignee: | mesa-dev |
Status: | RESOLVED WORKSFORME | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | abortretryfail, negativo17, truhland, walch.martin |
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Orion Poplawski
2014-09-08 21:21:20 UTC
Which version of glext.h (look for "GL_GLEXT_VERSION")? In version 20140810 it's defined on line 469: typedef ptrdiff_t GLintptr; /usr/include/GL/glext.h:#define GL_GLEXT_VERSION 20140810 But we're including "GL/glx.h" which includes "GL/glxext.h", not "GL/glext.h". Too many x's floating around here. # grep '^typedef .* GLintptr;' /usr/include/GL/*.h /usr/include/GL/glcorearb.h:typedef ptrdiff_t GLintptr; /usr/include/GL/glext.h:typedef ptrdiff_t GLintptr; I'll keep digging. #include "GL/glx.h" should pull in GL/gl.h (line 32) which should include GL/glext.h So by time we hit the use of GLintptr, it should have been defined. When I compile a trivial test program like this: #include <GL/glx.h> int main(void) { GLintptr p; return 0; } it seems to work. It seems that in GL/glx.h, GL/glext.h is only included when GL_GLEXT_LEGACY is not defined (line 2049). Unfortunatly, GL_GLEXT_LEGACY is defined in Rendering/OpenGL/vtkOpenGL.h (line 22) and vtkOpenGL.h is included in vtkXOpenGLRenderWindow.cxx that makes GL/glext.h not included and GLintptr not declared. This seems a little strange to me. So, make the test: $ cat gltest.c #define GL_GLEXT_LEGACY #include <GL/glx.h> int main(void) { GLintptr p; return 0; } $ gcc gltest.c In file included from /usr/include/GL/glx.h:333:0, from gltest.c:2: /usr/include/GL/glxext.h:480:143: error: unknown type name ‘GLintptr’ typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); ^ .... Now, I suppose it is kind of strange to define GL_GLEXT_LEGACY (not GLXEXT) and then include glx.h, but... I ran in to this problem trying to build OpenCASCADE for FreeCAD. Not sure if this is helpful or not, but the comment there says: // exclude modern definitions and system-provided glext.h, should be defined before gl.h inclusion #define GL_GLEXT_LEGACY I too ran into this bug when trying to install opencascade for freecad on Arch linux.
I added the following typedefs to a section of code that had been added in 10.3:
# diff glxext.h.saved glxext.h
479a480,481
> typedef ptrdiff_t GLsizeiptr;
> typedef ptrdiff_t GLintptr;
opencascade then compiled, installed with no issues.
With all due respect guys, should one take a closer look and remove the need for GL_GLEXT_LEGACY and its friends GL_GLEXT_PROTOTYPES/GLX_GLXEXT_PROTOTYPES. Iirc those were added as a workaround for ABI non-compliant users some ~10 years ago. Dropping the defines and fixing the build issues (not too many, I hope) seems like a better solution than adding another workaround/hack. Emil is correct. If your code defines GL_EXT_LEGACY you are also certainly doing it wrong. What happens if you remove that define from your build? Seems to be working now. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.