Important: Please read the Qt Code of Conduct -

Build Qt entirely with -no-c++11 for iOS

  • Hi.

    I have to build Qt 5.5.0 with -no-c++11 configure option for iOS.

    I tried but failed.

    Is this possible?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What error did you get ? What sources did you use ?

  • @SGaist

    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 \

    and this error is occurred.

    /Users/eliot/Library/Qt5.5.1/5.5/Src/qtbase/src/plugins/platforms/ios/ error: expected identifier
    m_focusWindowChangeConnection = QObject::connect(qApp, &QGuiApplication::focusWindowChanged, [self]{
    1 error generated.

    So I modified and commented out line 230, 248~260 that like this.

    and the error is gone but another error is happened.

    /Users/eliot/Library/Qt5.5.1/5.5/Src/qtbase/src/plugins/platforms/ios/ 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/ 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?".

  • Lifetime Qt Champion

    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 ?

  • @SGaist

    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.

  • Lifetime Qt Champion

    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.

  • @SGaist

    well.. I don't understand them, too. They are very famous company in the fields but very old fashioned.

    anyway I'll try to fix that. Thank you for your advices.

Log in to reply