[Interest] [Mingw-w64-public] Compiling Qt (4 or 5) with "-std=c++11"

K. Frank kfrank29.c at gmail.com
Thu Mar 21 22:30:12 CET 2013


Hi Thiago!

(I've taken the liberty of cross-posting this back to the mingw-w64-public
list.)

On Thu, Mar 21, 2013 at 5:07 PM, Thiago Macieira
<thiago.macieira at intel.com> wrote:
> On quinta-feira, 21 de março de 2013 16.52.29, K. Frank wrote:
>> Hello Lists!
>>
>> Should I expect to be able to build Qt with "-std=c++11" using mingw-w64?
>
> No. The Windows headers that are shipped with MinGW aren't standards-
> compliant. You need to compile with -std=gnu++11.

Thank you.  I will bear that in mind.  I don't see any problem with that.

> Qt automatically switches to that mode in the modules that require it.
>
>> As I understand it, using "-std=c++11" causes abi breakage, so to do this, I
>> will have to recompile the various libraries I use.
>
> Not with Qt. Qt has the very same ABI, whether you compile it with C++11 or
> C++98.

I guess I should take your word for it.  But I'm a little confused, so let me
ask for some clarification.  How does Qt control the abi produced by the
compiler?  I was under the distinct impression that "-std=???11" caused
significant abi breakage, that this was recognized as an issue, but, I
guess, that the gcc folks felt that it was worth it for some reason.

How could Qt manage to dodge that bullet?  Or am I misunderstanding
the issue?

>> Has anyone built Qt with either gcc 4.7 or 4.8 with "-std=c++11" activated?
>
> I know someone has, since there have been fixes for MinGW and C++11 mode coming
> in.
>
> I've been using C++11 and C++0x before that for a couple of years on Linux.
> Since GCC 4.4.

Excellent.

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


Thank you for the reassurance.


K. Frank



More information about the Interest mailing list