XCode iphoneos linker error with c++11 enabled



  • Hello,

    we have problems to link our software (uses C++11) against the iphoneos. For the following output I create a QML (Hello World) project in QtCreator. Without C++11 ist works fine but adding in the pro file the line

    @
    CONFIG += c++11
    @

    the result is

    @
    14:01:29: Unveränderte Konfiguration, qmake-Schritt wird übersprungen.
    14:01:29: Starte "/usr/bin/make"
    /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.ReleaseDevice
    ** BUILD FAILED **

    The following build commands failed:
    Ld Release-iphoneos/helloMoonwave.app/helloMoonwave normal armv7
    (1 failure)
    Build settings from command line:
    SDKROOT = iphoneos7.0

    === BUILD AGGREGATE TARGET Qt Preprocess OF PROJECT helloMoonwave WITH CONFIGURATION Release ===

    Ld Release-iphoneos/helloMoonwave.app/helloMoonwave normal armv7
    cd /Users/design/Moonwave/build/iphoneos_5.2.1/helloMoonwave
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/design/Moonwave/build/iphoneos_5.2.1/helloMoonwave/Release-iphoneos -L/Users/design/Qt5.2.1/5.2.1/ios/plugins/platforms -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks -L/Users/design/Qt5.2.1/5.2.1/ios/lib -L/Users/design/Qt5.2.1/5.2.1/ios/qml/QtQuick.2 -F/Users/design/Moonwave/build/iphoneos_5.2.1/helloMoonwave/Release-iphoneos -filelist /Users/design/Moonwave/build/iphoneos_5.2.1/helloMoonwave/helloMoonwave.build/Release-iphoneos/helloMoonwave.build/Objects-normal/armv7/helloMoonwave.LinkFileList -dead_strip -headerpad_max_install_names -stdlib=libc++ -u _qt_registerPlatformPlugin -L/Users/design/Qt5.2.1/5.2.1/ios/plugins/platforms -framework UIKit -L/Users/design/Qt5.2.1/5.2.1/ios/lib -framework OpenGLES -L/Users/design/Qt5.2.1/5.2.1/ios/qml/QtQuick.2 -lz -lm -miphoneos-version-min=5.0 -lqios -framework Foundation -framework QuartzCore -framework CoreFoundation -framework CoreText -framework CoreGraphics -lQt5PlatformSupport -framework Security -framework SystemConfiguration -lqtquick2plugin -lQt5Quick -lQt5Qml -lQt5Network -lQt5Gui -lQt5Core -Xlinker -dependency_info -Xlinker /Users/design/Moonwave/build/iphoneos_5.2.1/helloMoonwave/helloMoonwave.build/Release-iphoneos/helloMoonwave.build/Objects-normal/armv7/helloMoonwave_dependency_info.dat -o /Users/design/Moonwave/build/iphoneos_5.2.1/helloMoonwave/Release-iphoneos/helloMoonwave.app/helloMoonwave
    Undefined symbols for architecture armv7:
    "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.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.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.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.a(YarrPattern.o)
    std::vector<JSC::Yarr::PatternTerm, std::allocatorJSC::Yarr::PatternTerm >::reserve(unsigned long) in libQt5Qml.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.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.a(YarrPattern.o)
    ...
    "std::ios_base::Init::~Init()", referenced from:
    __GLOBAL__I_a in libQt5Qml.a(qqmlbundle.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4regexpobject.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4mm.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4functionobject.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4object.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4debugging.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4codegen.o)
    ...
    "std::ios_base::Init::Init()", referenced from:
    __GLOBAL__I_a in libQt5Qml.a(qqmlbundle.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4regexpobject.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4mm.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4functionobject.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4object.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4debugging.o)
    __GLOBAL__I_a in libQt5Qml.a(qv4codegen.o)
    ...
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    make[1]: *** [iphoneos-release] Error 65
    make: *** [release-iphoneos] Error 2
    14:01:30: Der Prozess "/usr/bin/make" wurde mit dem Rückgabewert 2 beendet.
    Fehler beim Erstellen/Deployment des Projekts helloMoonwave(Kit: iphoneos_5.2.1)
    Bei der Ausführung von Schritt 'Make'
    14:01:30: Verstrichene Zeit: 00:01.
    @

    Please help.


  • Lifetime Qt Champion

    Hi,

    IIRC you need to rebuild Qt with c++11 activated

    Hope it helps



  • Hi,

    I was hoping that this is not the solution:-) But I think also that helps.
    I check this.

    Looks bad, I have downloaded the source and start the configure:

    @
    ./configure -xplatform macx-ios-clang -release -c++11
    ...
    Configure summary

    Building on: macx-clang (x86_64, CPU features: mmx sse sse2 sse3 ssse3)
    Building for: macx-ios-clang (arm, CPU features: neon)

    Build options:
    Configuration .......... accessibility audio-backend build_all compile_examples concurrent cross_compile freetype full-config getaddrinfo getifaddrs gif iconv ipv6ifname jpeg large-config largefile medium-config minimal-config neon no-harfbuzz no-pkg-config opengl opengles2 pcre png precompile_header qpa qpa reduce_exports release small-config static system-zlib
    Build parts ............ libs
    Mode ................... release

    Using C++11 ............ no

    Using PCH .............. yes
    Target compiler supports:
    iWMMXt/Neon .......... no/yes
    @

    And now?


  • Lifetime Qt Champion


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.