Qt 5.5.0 get error 'undefined symbol architecture' when using in xcode with iphoneOS



  • it seems error comes out with SSL, anyone can help?

    below is error message

    defined symbols for architecture arm64:
    "_inflate", referenced from:
    QHttpNetworkReplyPrivate::uncompressBodyData(QByteDataBuffer*, QByteDataBuffer*) in libQt5Network.a(qhttpnetworkreply.o)
    "_inflateEnd", referenced from:
    QHttpNetworkReply::~QHttpNetworkReply() in libQt5Network.a(qhttpnetworkreply.o)
    QHttpNetworkReplyPrivate::clearHttpLayerInformation() in libQt5Network.a(qhttpnetworkreply.o)
    QHttpNetworkReplyPrivate::uncompressBodyData(QByteDataBuffer*, QByteDataBuffer*) in libQt5Network.a(qhttpnetworkreply.o)
    "_SSLCopyPeerTrust", referenced from:
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "_SecCertificateCopyData", referenced from:
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "_SecCertificateCreateWithData", referenced from:
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "_SecTrustSetAnchorCertificatesOnly", referenced from:
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "_SecTrustEvaluate", referenced from:
    -[QtNSURLConnectionDelegate connection:willSendRequestForAuthenticationChallenge:] in libQt5Network.a(qnetworkreplynsurlconnectionimpl.o)
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLSetProtocolVersionMax", referenced from:
    QSslSocketBackendPrivate::setSessionProtocol() in libQt5Network.a(qsslsocket_mac.o)
    "_kSecImportExportPassphrase", referenced from:
    QSslSocketBackendPrivate::setSessionCertificate(QString&, QAbstractSocket::SocketError&) in libQt5Network.a(qsslsocket_mac.o)
    "_kSecImportItemCertChain", referenced from:
    QSslSocketBackendPrivate::setSessionCertificate(QString&, QAbstractSocket::SocketError&) in libQt5Network.a(qsslsocket_mac.o)
    "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "_SSLSetCertificate", referenced from:
    QSslSocketBackendPrivate::setSessionCertificate(QString&, QAbstractSocket::SocketError&) in libQt5Network.a(qsslsocket_mac.o)
    "_SecTrustSetAnchorCertificates", referenced from:
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLHandshake", referenced from:
    QSslSocketBackendPrivate::startHandshake() in libQt5Network.a(qsslsocket_mac.o)
    "_pcre16_compile2", referenced from:
    QRegularExpressionPrivate::compilePattern() in libQt5Core.a(qregularexpression.o)
    "_SSLSetConnection", referenced from:
    QSslSocketBackendPrivate::initSslContext() in libQt5Network.a(qsslsocket_mac.o)
    "std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from:
    QXmppLogger::log(QXmppLogger::MessageType, QString const&) in libqxmpp.a(QXmppLogger.o)
    "_SSLGetNegotiatedProtocolVersion", referenced from:
    QSslSocketBackendPrivate::sessionProtocol() const in libQt5Network.a(qsslsocket_mac.o)
    "inflateInit2", referenced from:
    QHttpNetworkReplyPrivate::readHeader(QAbstractSocket*) in libQt5Network.a(qhttpnetworkreply.o)
    QHttpNetworkReplyPrivate::uncompressBodyData(QByteDataBuffer*, QByteDataBuffer*) in libQt5Network.a(qhttpnetworkreply.o)
    "_kSecImportItemIdentity", referenced from:
    QSslSocketBackendPrivate::setSessionCertificate(QString&, QAbstractSocket::SocketError&) in libQt5Network.a(qsslsocket_mac.o)
    "_SSLGetNumberSupportedCiphers", referenced from:
    QSslSocketPrivate::ensureInitialized() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLSetPeerDomainName", referenced from:
    QSslSocketBackendPrivate::initSslContext() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLGetNegotiatedCipher", referenced from:
    QSslSocketBackendPrivate::sessionCipher() const in libQt5Network.a(qsslsocket_mac.o)
    "_SSLClose", referenced from:
    QSslSocketBackendPrivate::disconnectFromHost() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLSetSessionOption", referenced from:
    QSslSocketBackendPrivate::initSslContext() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLSetClientSideAuthenticate", referenced from:
    QSslSocketBackendPrivate::initSslContext() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLCreateContext", referenced from:
    QSslSocketPrivate::ensureInitialized() in libQt5Network.a(qsslsocket_mac.o)
    QSslSocketBackendPrivate::initSslContext() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLGetSupportedCiphers", referenced from:
    QSslSocketPrivate::ensureInitialized() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLWrite", referenced from:
    QSslSocketBackendPrivate::transmit() in libQt5Network.a(qsslsocket_mac.o)
    "std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "_pcre16_config", referenced from:
    QRegularExpressionPrivate::getPatternInfo() in libQt5Core.a(qregularexpression.o)
    "_pcre16_jit_stack_free", referenced from:
    QThreadStorage<QPcreJitStackPointer*>::deleteData(void*) in libQt5Core.a(qregularexpression.o)
    "_SecPKCS12Import", referenced from:
    QSslSocketBackendPrivate::setSessionCertificate(QString&, QAbstractSocket::SocketError&) in libQt5Network.a(qsslsocket_mac.o)
    "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "_pcre16_exec", referenced from:
    pcre16SafeExec(real_pcre16 const*, pcre16_extra const*, unsigned short const*, int, int, int, int*, int) in libQt5Core.a(qregularexpression.o)
    "std::bad_alloc::bad_alloc()", referenced from:
    qBadAlloc() in libQt5Core.a(qglobal.o)
    QVector<QList<bool ()(void*)> >::reallocData(int, int, QFlagsQArrayData::AllocationOption) in libQt5Core.a(qglobal.o)
    "std::__1::cout", referenced from:
    QXmppLogger::log(QXmppLogger::MessageType, QString const&) in libqxmpp.a(QXmppLogger.o)
    "std::__1::ios_base::getloc() const", referenced from:
    QXmppLogger::log(QXmppLogger::MessageType, QString const&) in libqxmpp.a(QXmppLogger.o)
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "_SecTrustGetCertificateCount", referenced from:
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "std::__1::ios_base::clear(unsigned int)", referenced from:
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "_pcre16_jit_stack_alloc", referenced from:
    pcre16SafeExec(real_pcre16 const*, pcre16_extra const*, unsigned short const*, int, int, int, int*, int) in libQt5Core.a(qregularexpression.o)
    "_SSLRead", referenced from:
    QSslSocketBackendPrivate::transmit() in libQt5Network.a(qsslsocket_mac.o)
    "_SSLSetIOFuncs", referenced from:
    QSslSocketBackendPrivate::initSslContext() in libQt5Network.a(qsslsocket_mac.o)
    "std::__1::ctype<char>::id", referenced from:
    QXmppLogger::log(QXmppLogger::MessageType, QString const&) in libqxmpp.a(QXmppLogger.o)
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "std::__1::locale::~locale()", referenced from:
    QXmppLogger::log(QXmppLogger::MessageType, QString const&) in libqxmpp.a(QXmppLogger.o)
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "_uncompress", referenced from:
    qUncompress(unsigned char const*, int) in libQt5Core.a(qbytearray.o)
    "_pcre16_study", referenced from:
    QRegularExpressionPrivate::optimizePattern(QRegularExpressionPrivate::OptimizePatternOption) in libQt5Core.a(qregularexpression.o)
    "_pcre16_assign_jit_stack", referenced from:
    QRegularExpressionPrivate::optimizePattern(QRegularExpressionPrivate::OptimizePatternOption) in libQt5Core.a(qregularexpression.o)
    "_SecTrustGetCertificateAtIndex", referenced from:
    QSslSocketBackendPrivate::verifyPeerTrust() in libQt5Network.a(qsslsocket_mac.o)
    "std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)", referenced from:
    QXmppLogger::log(QXmppLogger::MessageType, QString const&) in libqxmpp.a(QXmppLogger.o)
    "_pcre16_fullinfo", referenced from:
    QRegularExpressionPrivate::getPatternInfo() in libQt5Core.a(qregularexpression.o)
    "void std::__1::__sort<std::__1::__less<int, int>&, int*>(int*, int*, std::__1::__less<int, int>&)", referenced from:
    QString::multiArg(int, QString const**) const in libQt5Core.a(qstring.o)
    "_pcre16_free_study", referenced from:
    QRegularExpressionPrivate::~QRegularExpressionPrivate() in libQt5Core.a(qregularexpression.o)
    QRegularExpressionPrivate::compilePattern() in libQt5Core.a(qregularexpression.o)
    "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
    QXmppLogger::log(QXmppLogger::MessageType, QString const&) in libqxmpp.a(QXmppLogger.o)
    std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libqxmpp.a(QXmppLogger.o)
    "_SSLSetProtocolVersionMin", referenced from:
    QSslSocketBackendPrivate::setSessionProtocol() in libQt5Network.a(qsslsocket_mac.o)
    "_pcre16_free", referenced from:
    QRegularExpressionPrivate::~QRegularExpressionPrivate() in libQt5Core.a(qregularexpression.o)
    QRegularExpressionPrivate::compilePattern() in libQt5Core.a(qregularexpression.o)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)


  • Lifetime Qt Champion

    Hi,

    Is this a custom build of Qt ?



  • @SGaist
    No, i am using Qt build library.
    In the beginning, i just useing libQt5Core, libQt5Network, libQt5Xml, because it works perfectly on android. but it comes out many problems when i use it on iOS.
    eventually, i was able to fix it.
    The error message on Xcode , include below issue

    1. SSL issue
      i fixed SSL issue by importing xcode library Security.framework. i hope it could be mentioned that Security.framework is needed on iOS in the document, if Qt lib needs it.
    2. pcre issue
      import qt third party library e.g. qtpcre library
    3. std issue
      change xcode c++ standard library setting to libc++

    thank you for replying my question.


  • Lifetime Qt Champion

    1. What parameter did you use when compiling Qt for iOS ?
    2. What is your issue with PCRE ?


  • @SGaist
    i didn't compile Qt for iOS, i just use the Qt library to iOS,
    and only include them on xcode, then run app, and it put me error above.

    the three lib i have to use is QtCore, QtNetwork, QtXml, and it works great on android,
    i don't know what iOS needs the PCRE lib, but it did, maybe it cause QRegularExpression use in libQtCore


  • Lifetime Qt Champion

    What version of OS X and Xcode are you running ?


Log in to reply
 

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