GNOME Bugzilla – Bug 754732
gl: (ubuntu) error: conflicting types for 'GLsizeiptr' (& more)
Last modified: 2015-09-11 08:12:20 UTC
I'm not sure what it is about our environment (we disable gl and use gles on armhf?) but there are typedef conflicts when building -bad on Ubuntu. I don't really know about gl/gles so this patch might not make sense, but I found that you can define GL_GLEXT_LEGACY and GLX_GLXEXT_LEGACY to switch to a different mode in which these conflicts don't happen. When you define these things then there's a linker failure because ext/qt doesn't link with qt directly, so I also added that. Since I don't really know if this good, if anyone knows of a better way, let's do that.
Created attachment 310919 [details] [review] gl: Define GL_GLEXT_LEGACY and GLX_GLXEXT_LEGACY To prevent conflicting declarations of OpenGL types, e.g. In file included from /usr/include/GL/gl.h:2055:0, from /usr/include/GL/glx.h:32, from ../../gst-libs/gst/gl/x11/gstglcontext_glx.h:26, from gtkgstglwidget.c:33: /usr/include/GL/glext.h:468:19: error: conflicting types for 'GLsizeiptr' typedef ptrdiff_t GLsizeiptr; In file included from ../../gst-libs/gst/gl/gstglapi.h:35:0, from ../../gst-libs/gst/gl/gstgl_fwd.h:26, from ../../gst-libs/gst/gl/gl.h:29, from gtkgstglwidget.h:26, from gtkgstglwidget.c:27: /usr/include/GLES2/gl2.h:69:25: note: previous declaration of 'GLsizeiptr' was here typedef khronos_ssize_t GLsizeiptr; Once this is in place, we get a linker failure relating to "glBindTexture" - we need to link libqtsink to gl (or gles) to avoid this.
Created attachment 310920 [details] build log search for 'conflicting types' - this was a parallel build
If you're passing --disable-opengl, you should also pass --disable-glx as glx only really makes sense for opengl systems. And gles2 on glx, while possible through context profile's, hasn't been added to gstgl. Does that help?
No sorry, still the same errors.
Created attachment 310983 [details] [review] qt: use our function table instead of directly calling gl functions
Created attachment 310984 [details] [review] gtk, qt: more specifically define the compile time requirements
Could you try with these patches on top of git master of gst-plugins-bad? The first should solve the link time error in qt The second should solve the erroneous #include glx with --disable-glx
Comment on attachment 310984 [details] [review] gtk, qt: more specifically define the compile time requirements Additional to that, we should also make sure that this code is only *built* if one of the possible configurations is available.
Created attachment 311033 [details] [review] gtk, qt: more specifically define the compile time requirements v2 which includes configure time guards as well
Comment on attachment 311033 [details] [review] gtk, qt: more specifically define the compile time requirements commit 38d360675c450ca8f89af6c42d1d0a2e85434437 Author: Matthew Waters <matthew@centricular.com> Date: Thu Sep 10 00:07:18 2015 +1000 gtk, qt: more specifically define the compile time requirements Otherwise we could include headers/configurations that will never been installed. https://bugzilla.gnome.org/show_bug.cgi?id=754732 commit bca1fd1040ab085b63895b92720eb448df438bfa Author: Matthew Waters <matthew@centricular.com> Date: Thu Sep 10 00:00:11 2015 +1000 qt: use our function table instead of directly calling gl functions Otherwise when building with --as-needed we would need to link to a GL or GLES library. https://bugzilla.gnome.org/show_bug.cgi?id=754732
Let's close this for now, please reopen if the problem persists.
Thanks guys, those patches fix it for me, going to ship them in Ubuntu for now (and delete when the next -bad version pops out)