[Interest] Several issues compiling Qt 4.8.4 with mingw-w64 4.8.1, possible related to "-std=gnu++11"

K. Frank kfrank29.c at gmail.com
Tue Apr 16 00:18:36 CEST 2013

Hi Thiago -

On Mon, Apr 15, 2013 at 5:52 PM, Thiago Macieira
<thiago.macieira at intel.com> wrote:
> On segunda-feira, 15 de abril de 2013 14.43.22, K. Frank wrote:
>>    ..\3rdparty\javascriptcore\JavaScriptCore/wtf/HashTable.h:264:83:
>> error: 'template<class T, class U> void QTWTF::swap(std::pair<_T1,
>> ...
> JavaScriptCore does not compile with C++11 (at least, not the versions inside
> Qt 4.8).

Thank you for the clear answer.  As a follow-up, do you think it is close
enough to being compilable with c++11 that I might be able to patch it
myself?   Or would that be a trip down the rabbit hole, so to speak?

> That means you need to disable C++11 when compiling both QtScript and
> QtWebKit.
> The buildsystem for those *does* remove -std=c++0x and -std=gnu++0x, so if you
> use the old switches, Qt should compile.

I don't follow what you mean here.  Could you explain how the build
system goes about removing -std=gnu++11?  (In my case it didn't.)
And what you mean when you refer to "the old switches"?

I should mention that I "turned on" "-std=gnu++11" by adding it to
qmake.conf, specifically:

   QMAKE_CXXFLAGS *= -std=gnu++11 -fno-keep-inline-dllexport

I also have the concern that if I do turn off c++11 when building
QtScript / QtWebKit, even if the Qt build succeeds, I would still
expect compiling any of my own code that jointly uses c++11 and
QtScript / QtWebKit to fail because I am seeing the compilation
errors in the header files.  Is this a legitimate concern?  If so, is
there some way I might work around it?

One more note:  I ran configure with "-no-webkit".  Do you think that
if I also add "-no-script" to my configure that I will be able to build Qt
with c++11 turned on?

I haven't (explicitly) used QtScript.  What would I be giving up if I
turned it off?

> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center

Thanks very much for your advice.

K. Frank

More information about the Interest mailing list