Bug 70591 - glxext.h:275: error: redefinition of typedef ‘GLXContextID’
Summary: glxext.h:275: error: redefinition of typedef ‘GLXContextID’
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-10-17 22:15 UTC by Vinson Lee
Modified: 2014-01-19 08:38 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2013-10-17 22:15:17 UTC
mesa: b3360d23ac1db61390b2ac8963756c6133ba6e23 (master)

  CC     clientattrib.lo
In file included from ../../include/GL/glx.h:333,
                 from glxclient.h:45,
                 from clientattrib.c:32:
../../include/GL/glxext.h:275: error: redefinition of typedef ‘GLXContextID’
../../include/GL/glx.h:171: note: previous declaration of ‘GLXContextID’ was here
Comment 1 Brian Paul 2013-10-18 14:54:33 UTC
If removing the GLXContextID typedef from glx.h works for you, feel free to submit a patch.

GLXContextID isn't actually used anywhere else in glx.h
Comment 2 Vinson Lee 2013-10-19 01:48:22 UTC
commit 136a12ac98868d82c2ae9fcc80d11044a7ec56d1
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Fri Oct 18 17:40:40 2013 -0700

    mesa: Remove GLXContextID typedef from glx.h.
    
    Fixes this build error.
    
      CC     clientattrib.lo
    In file included from ../../include/GL/glx.h:333,
                     from glxclient.h:45,
                     from clientattrib.c:32:
    ../../include/GL/glxext.h:275: error: redefinition of typedef ‘GLXContextID’
    ../../include/GL/glx.h:171: note: previous declaration of ‘GLXContextID’ was here
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70591
    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Comment 3 Kenneth Graunke 2013-12-30 07:23:57 UTC
Applications such as Allergo rely on this typedef existing in glx.h, and removing it apparently breaks their application's build.

Mesa builds fine without Vinson's patch for me, using GCC on Linux, so for now I've gone ahead and reverted it from master.

The typedef is really part of GLX proper, and not an extension, so it seems like it belongs in glx.h with the others, not glxext.h.

I'm reopening this bug because presumably Vinson's issue is back.  Hopefully we can come up with another solution.
Comment 4 Vinson Lee 2013-12-31 01:09:25 UTC
mesa: 5a51c1b01a16d3256f9769a76d8293fea5853b1f (master)

The build error appears to be compiler dependent. I can reproduce the build error with gcc 4.4 or clang 2.8 on CentOS 6. I can also reproduce the build error with gcc-4.4, but not with gcc 4.8, on Ubuntu 13.10.

$ ./autogen.sh --disable-dri3 --with-dri-drivers=swrast --with-gallium-drivers=
$ make
  CC     clientattrib.lo
In file included from ../../include/GL/glx.h:333,
                 from glxclient.h:45,
                 from clientattrib.c:32:
../../include/GL/glxext.h:275: error: redefinition of typedef ‘GLXContextID’
../../include/GL/glx.h:171: note: previous declaration of ‘GLXContextID’ was here
Comment 5 Eric Anholt 2013-12-31 19:21:45 UTC
glxext.h shouldn't have grown the new typedef.  I've opened https://cvs.khronos.org/bugzilla/show_bug.cgi?id=11454 for this.
Comment 6 Vinson Lee 2014-01-19 08:38:17 UTC
commit f8432832a7f3d3cc01f8bab8358069029d575ef0
Author: Vinson Lee <vlee@freedesktop.org>
Date:   Mon Jan 6 12:09:29 2014 -0800

    mesa: Remove GLXContextID typedef from glxext.h.
    
    This patch fixes this build error with gcc <= 4.5 and clang <= 3.1.
    
      CC     clientattrib.lo
    In file included from ../../include/GL/glx.h:333:0,
                     from glxclient.h:45,
                     from clientattrib.c:32:
    ../../include/GL/glxext.h:275:13: error: redefinition of typedef 'GLXContextID'
    ../../include/GL/glx.h:171:13: note: previous declaration of 'GLXContextID' was here
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70591
    Signed-off-by: Vinson Lee <vlee@freedesktop.org>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>


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.