Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. C++11 and INCLUDE error in iOS
Forum Updated to NodeBB v4.3 + New Features

C++11 and INCLUDE error in iOS

Scheduled Pinned Locked Moved Mobile and Embedded
11 Posts 3 Posters 4.0k 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.
  • freddy311082F Offline
    freddy311082F Offline
    freddy311082
    wrote on last edited by
    #1

    Hi guys

    I'm trying tu make an app for iPad 2 with iOS 7.0. In my .pro file I have:

    @
    CONFIG += C++11
    INCLUDE += ./euler
    @

    where euler is a directory from my API, for example...

    Where, when I comment this 2 lines in the .pro, my app work fine in the iOS emulator and into my iPad, but if I don't comment this 2 lines, QtCreator give me the following error:

    @
    The following build commands failed:

    Ld Debug-iphonesimulator/PilarAppBeta.app/PilarAppBeta normal i386

    (1 failure)

    make[1]: *** [iphonesimulator-debug] Error 65

    make: *** [debug-iphonesimulator] Error 2

    Undefined symbols for architecture i386:

    "std::ios_base::Init::Init()", referenced from:

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qqmlbundle.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4regexpobject.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4mm.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4functionobject.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4object.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4debugging.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4codegen.o)

    ...

    "std::ios_base::Init::~Init()", referenced from:

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qqmlbundle.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4regexpobject.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4mm.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4functionobject.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4object.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4debugging.o)

    ___cxx_global_var_init in libQt5Qml_iphonesimulator_debug.a(qv4codegen.o)

    "std::__throw_length_error(char const*)", referenced from:

    std::vector<OwnPtrJSC::Yarr::CharacterClass, std::allocator<OwnPtrJSC::Yarr::CharacterClass > >::_M_insert_aux(__gnu_cxx::__normal_iterator<OwnPtrJSC::Yarr::CharacterClass*, std::vector<OwnPtrJSC::Yarr::CharacterClass, std::allocator<OwnPtrJSC::Yarr::CharacterClass > > >, OwnPtrJSC::Yarr::CharacterClass const&) in libQt5Qml_iphonesimulator_debug.a(YarrPattern.o)

    std::vector<unsigned short, std::allocator<unsigned short> >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned short*, std::vector<unsigned short, std::allocator<unsigned short> > >, unsigned short const&) in libQt5Qml_iphonesimulator_debug.a(YarrPattern.o)

    std::vector<JSC::Yarr::PatternTerm, std::allocatorJSC::Yarr::PatternTerm >::_M_insert_aux(__gnu_cxx::__normal_iterator<JSC::Yarr::PatternTerm*, std::vector<JSC::Yarr::PatternTerm, std::allocatorJSC::Yarr::PatternTerm > >, JSC::Yarr::PatternTerm const&) in libQt5Qml_iphonesimulator_debug.a(YarrPattern.o)

    std::vector<OwnPtrJSC::Yarr::PatternDisjunction, std::allocator<OwnPtrJSC::Yarr::PatternDisjunction > >::_M_insert_aux(__gnu_cxx::__normal_iterator<OwnPtrJSC::Yarr::PatternDisjunction*, std::vector<OwnPtrJSC::Yarr::PatternDisjunction, std::allocator<OwnPtrJSC::Yarr::PatternDisjunction > > >, OwnPtrJSC::Yarr::PatternDisjunction const&) in libQt5Qml_iphonesimulator_debug.a(YarrPattern.o)

    std::vector<JSC::Yarr::PatternTerm, std::allocatorJSC::Yarr::PatternTerm >::reserve(unsigned long) in libQt5Qml_iphonesimulator_debug.a(YarrPattern.o)

    std::vector<OwnPtrJSC::Yarr::PatternAlternative, std::allocator<OwnPtrJSC::Yarr::PatternAlternative > >::_M_insert_aux(__gnu_cxx::__normal_iterator<OwnPtrJSC::Yarr::PatternAlternative*, std::vector<OwnPtrJSC::Yarr::PatternAlternative, std::allocator<OwnPtrJSC::Yarr::PatternAlternative > > >, OwnPtrJSC::Yarr::PatternAlternative const&) in libQt5Qml_iphonesimulator_debug.a(YarrPattern.o)

    std::vector<JSC::Yarr::CharacterRange, std::allocatorJSC::Yarr::CharacterRange >::_M_insert_aux(__gnu_cxx::__normal_iterator<JSC::Yarr::CharacterRange*, std::vector<JSC::Yarr::CharacterRange, std::allocatorJSC::Yarr::CharacterRange > >, JSC::Yarr::CharacterRange const&) in libQt5Qml_iphonesimulator_debug.a(YarrPattern.o)

    ...

    ld: symbol(s) not found for architecture i386

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    17:00:09: The process "/usr/bin/make" exited with code 2.

    Error while building/deploying project PilarAppBeta (kit: iphonesimulator-clang Qt 5.2.1 for iOS)

    When executing step 'Make'

    17:00:09: Elapsed time: 00:04.
    @

    so, my quetion is... how can I make my iOS app compatible with C++11 ??? What Am I doing wrong ??

    best regard

    freddy

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #2

      I haven't tried an iOS app yet, but I know when you build a C++11 OSX app, you need a small 'c' on the config line, not a capital C, like this
      @CONFIG += c++11@

      Maybe it's the same problem for iOS apps?
      (also see "my blog post":http://www.tripleboot.org/?p=101 about this)

      1 Reply Last reply
      0
      • freddy311082F Offline
        freddy311082F Offline
        freddy311082
        wrote on last edited by
        #3

        Hi hskoglund... thanks for answer...

        and yes bro, you are right, i have:

        @
        INCLUDEPATH += ./euler
        CONFIG += c++11
        @

        the above example I hade made a mistake typing. sorry for that...

        When I compile my app for desktop all is fine, but when I try to compile for iOS device, i get the error number 65...

        any other advices ??

        thanks

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

          Hi,

          IIRC, c++11 is not enabled by default on iOS, you would need to build Qt yourself to use it

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

          1 Reply Last reply
          0
          • freddy311082F Offline
            freddy311082F Offline
            freddy311082
            wrote on last edited by
            #5

            Ty SGaist... for your aclaration !!!

            regards

            1 Reply Last reply
            0
            • hskoglundH Offline
              hskoglundH Offline
              hskoglund
              wrote on last edited by
              #6

              SGaist, might be off topic, but you mean c++11 is not enabled for Qt-flavored iOS apps?
              Because I can use C++11 things like ranged for loops in my "vanilla" iOS (i.e. built with Xcode) apps without problems...

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

                I mean that Qt for iOS looks like not configured to use c++11 (i don't know however if it's intentional or not)

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

                1 Reply Last reply
                0
                • hskoglundH Offline
                  hskoglundH Offline
                  hskoglund
                  wrote on last edited by
                  #8

                  Ok maybe something for Qt 5.3's wishlist? Anyway, c++11 support is pretty new in Xcode (since Xcode 5.0 I think).

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

                    At least worth to ask on the interest mailing list

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

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

                      If I saw things correctly, the c++11 switch is now enabled (so it should be in for Qt 5.3)

                      If I understood things correctly it was due to the minimum iOS version supported which will now be iOS 5.0

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

                      1 Reply Last reply
                      0
                      • hskoglundH Offline
                        hskoglundH Offline
                        hskoglund
                        wrote on last edited by
                        #11

                        Neat, I should download 5.3 and give it a try.

                        (It's easy to get tired of those longwinded method names in Objective-C, if Qt can give me 100% C++11 in iOS, that could save my fingers a bit of typing pain :-)

                        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