Building 5.2 (stable) with libc++ for c++11 support?
It seems that the iOS configuration builds Qt against the libstdc++ GNU library and not the default, libc++. The libstdc++ included in the iOS SDK appears to be old and lacking c++11 support.
Has anyone built Qt for iOS with c++11 support? In theory the compiler/linker flag "-stdlib=libc++" should fix everything, but I don't know where that's being set...
It should be set in the macx-ios-clang mkspec
Thanks SGaist. I seem to have gotten it working by adding "c++11" to the "CONFIG +=" line in qtbase/mkspecs/macx-ios-clang/qmake.conf.
This should be the default, as libc++ is now the default for iOS and the provided libstdc++ is old and doesn't include c++11 support. Should this be a bug report?
Before that you should ask on the interest mailing list, you'll find Qt's developers/maintainers there (this forum is more user oriented). Don't forget to subscribe first.
So was the solution to recompile Qt for iOS with c++11 using the method that rosetter described (modifying the qtbase/mkspecs/macx-ios-clang/qmake.conf file)?
[quote author="kersson" date="1392188702"]So was the solution to recompile Qt for iOS with c++11 using the method that rosetter described (modifying the qtbase/mkspecs/macx-ios-clang/qmake.conf file)?[/quote]
yes, that's what works for me.
I have changed the qmake.conf in the way you described. But after a configure the line which shows the C++11 support says no.
Will it work yet?
kortus, even though the line says C++11...no, it is actually enabled. I confirmed that after making the change to the mkspec and compiling Qt for iOS, I was able to compile and deploy projects with CONFIG += c++11 for both simulator and device.
However, I'm still working on a solving a "semi-related issue.":http://qt-project.org/forums/viewthread/38541/
Let me know if you have any thoughts :)
kersson, you are right, it works.
Could you please provide us the steps for doing the Qt compilation?
Is there any information about the compilation steps of the Qt provided at http://qt-project.org/downloads?
Do you mean the exact parameter they use ?
Personally I used the line provided "here":http://qt-project.org/doc/qt-5/building-from-source-ios.html
SGaist, thanks for replying.
Yes, I meant that (Sorry for my english).
What if I want to build all the Qt "products" included in the download page?
I want to build them in the same way (exact the same) as Qt does.
My question is: what are the parameters (to the configure script) used by Qt for the products provided in the download page?
Is there any information about this?
I have another doubt:
I checked the file:
In the last file, the following is specified:
QMAKE_CXXFLAGS_CXX11 += -stdlib=libc++
QMAKE_LFLAGS_CXX11 += -stdlib=libc++
(This is the same for Qt5.2)
According to what I understand, Qt 5.2 and 5.3 (ios) are compiled to use LibC++.
I do not understand why it is not.
You have that "wiki entry":http://qt-project.org/wiki/Building-Qt-Package that explains how.
I don't understand your last question. Since 5.2, they do use libc++