Build Qt entirely with -no-c++11 for iOS
-
Hi and welcome to devnet,
What error did you get ? What sources did you use ?
-
Thank you for your reply.
I tried to build again using 5.5.1 source from Qt installer but failed.
First, this is the configure options I'm using.-xplatform macx-ios-clang \ -sdk iphoneos8.4 \ -opensource \ -release \ -prefix /opt/qt/5.5.1/ios \ -confirm-license \ -nomake examples \ -nomake tests \ -no-c++11
and this error is occurred.
/Users/eliot/Library/Qt5.5.1/5.5/Src/qtbase/src/plugins/platforms/ios/qiosviewcontroller.mm:258:107: error: expected identifier
m_focusWindowChangeConnection = QObject::connect(qApp, &QGuiApplication::focusWindowChanged, [self]{
^
1 error generated.So I modified qiosviewcontroller.mm and commented out line 230, 248~260 that like this.
http://i.imgur.com/co24FhU.png
and the error is gone but another error is happened.
/Users/eliot/Library/Qt5.5.1/5.5/Src/qtbase/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm:130:10: error: no type named 'atomic_bool' in namespace 'std'
std::atomic_bool m_stop;
~~~~~^
/Users/eliot/Library/Qt5.5.1/5.5/Src/qtbase/src/plugins/platforms/ios/qiosfileengineassetslibrary.mm:130:22: warning: private field 'm_stop' is not used [-Wunused-private-field]
std::atomic_bool m_stop;
^Can I replace atomic_bool to primitive bool in here?
As I know, atomic is included since C++11.
So I think Qtbase's iOS plugin is based on C++11.
Therefore I think I can't build Qt with -no-c++11 option.
That's why I asked "Is this possible?". -
Indeed those are C++11 features. But before doing changes to avoid use of C++11: why do you want to disable C++11 in Qt's build ?
-
I'm working with a DRM/CAS company now.
Their DRM/CAS libraries and build tools support only libstdc++.
and their build tools replace Xcode's clang, ld and something as a wrapper.
So when I compile our source (Qt iOS) with these things in Xcode, a few link errors are occurred.
Because of that, I have to disable C++11.
-
Are they aware that we're almost in 2016 ?
No, since m_stop is a flag, you can replace it with a QAtomicInt, the handling is a bit different but at least you're still using an atomic operation to do it.
Then replace the lambda by a private slot.
You can't just comment out code like that and expect it to continue to work the same.