Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Build Qt entirely with -no-c++11 for iOS
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    eliot
    wrote on last edited by eliot
    #1

    Hi.

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

    I tried but failed.

    Is this possible?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      E 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

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

        E Offline
        E Offline
        eliot
        wrote on last edited by eliot
        #3

        @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 \
        -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?".

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          E 1 Reply Last reply
          0
          • SGaistS SGaist

            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 ?

            E Offline
            E Offline
            eliot
            wrote on last edited by eliot
            #5

            @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.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              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.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              E 1 Reply Last reply
              0
              • SGaistS SGaist

                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.

                E Offline
                E Offline
                eliot
                wrote on last edited by
                #7

                @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.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved