[Interest] C++11 in Qt5

Stephen Chu stephen at ju-ju.com
Tue Jun 12 21:16:38 CEST 2012


On 6/11/12 10:49 PM, Rohan McGovern wrote:
> Stephen Chu said:
>> I just pulled Qt 5 from git and don't see the new C++11 option. They are
>> in the master branch of qtbase but Qt 5 doesn't pull that in yet.
>>
>
> Right, that's actually because it appears to have caused a few
> regressions. The new qtbase will only arrive in qt5's git once all
> known regressions are fixed.
>

Thanks to letting me know.

I am curious if the runtime issue on OS X has been dealt with? By that I 
mean when using clang tool chain, enabling std=c++11 on Mac requires 
also setting -stdlib=libc++ or the compiler will use the old GCC headers 
which results errors like this:

In file included from main.cpp:1:
In file included from /Qt/5.0/qtbase/include/QtCore/QtCore:4:
In file included from /Qt/5.0/qtbase/include/QtCore/qabstractanimation.h:1:
In file included from 
/Qt/5.0/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:45:
In file included from /Qt/5.0/qtbase/include/QtCore/qobject.h:1:
In file included from 
/Qt/5.0/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:50:
In file included from /Qt/5.0/qtbase/include/QtCore/qlist.h:1:
/Qt/5.0/qtbase/include/QtCore/../../src/corelib/tools/qlist.h:52:10: 
fatal error: 'initializer_list' file not found
#include <initializer_list>
          ^

However, libc++ is only available on OS X 10.7 or later. Enabling it 
gets you errors like this:

clang: error: invalid deployment target for -stdlib=libc++ (requires OS 
X 10.7 or later)

That's caused from "-mmacosx-version-min=10.6" set in the mkspec.

Does this mean we can only enable C+11 features when targeting 10.7 or 
later? We'll also need a new set of mkspecs to go with that.



More information about the Interest mailing list