You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, April 24th 2012, 3:44pm

error: 'union' tag used in naming 'struct _GMutex'

Hi all,

I've been trying to build Qt 4.8.0 from sources on CentOS 6.2 (x86_64).
I installed libffi-devel, glib 2.32.0 and gstreamer 0.10.36 before.
And I installed no other package.

When I did "make" command for Qt, I got errors as below:
> /usr/local/include/glib-2.0/glib/gthread.h:51: error: 'union' tag used in naming 'struct _GMutex'
> /usr/local/include/glib-2.0/glib/gthread.h:58: error: 'union' tag used in naming 'struct _GMutex'

How could I solve the problem?

2

Friday, June 8th 2012, 4:30am

This is a bit old so maybe you've figured it out before now, but the problem is that glib changed _GMutex from a struct to a union, and the WebKit code hasn't caught up.

grep in the Qt source code for _GMutex, and change any instances that you find from struct to union. The build went fine for me after I did that.


rfbrown@blah:~/projects/qt-everywhere-opensource-src-4.8.2$ grep -R -n _GMutex *
src/3rdparty/webkit/Source/JavaScriptCore/wtf/gobject/GTypedefs.h:55:typedef struct _GMutex GMutex;

src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h:92:typedef struct _GMutex GMutex;