After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754732 - gl: (ubuntu) error: conflicting types for 'GLsizeiptr' (& more)
gl: (ubuntu) error: conflicting types for 'GLsizeiptr' (& more)
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal normal
: 1.5.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-08 16:45 UTC by Iain Lane
Modified: 2015-09-11 08:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gl: Define GL_GLEXT_LEGACY and GLX_GLXEXT_LEGACY (2.14 KB, patch)
2015-09-08 16:45 UTC, Iain Lane
none Details | Review
build log (98.33 KB, application/gzip)
2015-09-08 16:47 UTC, Iain Lane
  Details
qt: use our function table instead of directly calling gl functions (1.58 KB, patch)
2015-09-09 14:11 UTC, Matthew Waters (ystreet00)
committed Details | Review
gtk, qt: more specifically define the compile time requirements (3.45 KB, patch)
2015-09-09 14:12 UTC, Matthew Waters (ystreet00)
none Details | Review
gtk, qt: more specifically define the compile time requirements (6.84 KB, patch)
2015-09-10 03:12 UTC, Matthew Waters (ystreet00)
committed Details | Review

Description Iain Lane 2015-09-08 16:45:43 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.
Comment 1 Iain Lane 2015-09-08 16:45:48 UTC
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.
Comment 2 Iain Lane 2015-09-08 16:47:29 UTC
Created attachment 310920 [details]
build log

search for 'conflicting types' - this was a parallel build
Comment 3 Matthew Waters (ystreet00) 2015-09-09 01:27:54 UTC
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?
Comment 4 Iain Lane 2015-09-09 10:47:03 UTC
No sorry, still the same errors.
Comment 5 Matthew Waters (ystreet00) 2015-09-09 14:11:59 UTC
Created attachment 310983 [details] [review]
qt: use our function table instead of directly calling gl functions
Comment 6 Matthew Waters (ystreet00) 2015-09-09 14:12:31 UTC
Created attachment 310984 [details] [review]
gtk, qt: more specifically define the compile time requirements
Comment 7 Matthew Waters (ystreet00) 2015-09-09 14:15:17 UTC
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 8 Sebastian Dröge (slomo) 2015-09-09 14:19:19 UTC
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.
Comment 9 Matthew Waters (ystreet00) 2015-09-10 03:12:46 UTC
Created attachment 311033 [details] [review]
gtk, qt: more specifically define the compile time requirements

v2 which includes configure time guards as well
Comment 10 Matthew Waters (ystreet00) 2015-09-10 08:31:12 UTC
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
Comment 11 Sebastian Dröge (slomo) 2015-09-10 11:31:10 UTC
Let's close this for now, please reopen if the problem persists.
Comment 12 Iain Lane 2015-09-11 08:12:20 UTC
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)