Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

cmake generate IOS project : Undefined symbols for architecture arm64



  • ![0_1539684472599_601e19a9-a64d-4962-9bef-7ae3be382fb5-image.png](Uploading 25%)

    I use cmake to create a IOS project . but Xcode occur a "Undefined symbols" when
    build it.

    the link error is blow:

    Undefined symbols for architecture arm64:
    "_pcre2_match_16", referenced from:
    safe_pcre2_match_16(pcre2_real_code_16 const*, unsigned short const*, int, int, int, pcre2_real_match_data_16*, pcre2_real_match_context_16*) in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_match_context_create_16", referenced from:
    QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlagsQRegularExpression::MatchOption, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_jit_stack_assign_16", referenced from:
    QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlagsQRegularExpression::MatchOption, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_jit_stack_create_16", referenced from:
    QPcreJitStackPointer::QPcreJitStackPointer() in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_match_data_create_from_pattern_16", referenced from:
    QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlagsQRegularExpression::MatchOption, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_jit_stack_free_16", referenced from:
    QPcreJitStackPointer::~QPcreJitStackPointer() in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_get_ovector_pointer_16", referenced from:
    QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlagsQRegularExpression::MatchOption, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_match_data_free_16", referenced from:
    QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlagsQRegularExpression::MatchOption, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_jit_compile_16", referenced from:
    QRegularExpressionPrivate::optimizePattern(QRegularExpressionPrivate::OptimizePatternOption) in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_config_16", referenced from:
    QRegularExpressionPrivate::getPatternInfo() in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_pattern_info_16", referenced from:
    QRegularExpressionPrivate::getPatternInfo() in libQt5Core_debug.a(qregularexpression.o)
    QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlagsQRegularExpression::MatchOption, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_code_free_16", referenced from:
    QRegularExpressionPrivate::cleanCompiledPattern() in libQt5Core_debug.a(qregularexpression.o)
    "_kUTTagClassFilenameExtension", referenced from:
    isPackage(QFileSystemMetaData const&, QFileSystemEntry const&) in libQt5Core_debug.a(qfilesystemengine_unix.o)
    "_UTTypeConformsTo", referenced from:
    isPackage(QFileSystemMetaData const&, QFileSystemEntry const&) in libQt5Core_debug.a(qfilesystemengine_unix.o)
    "_pcre2_match_context_free_16", referenced from:
    QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlagsQRegularExpression::MatchOption, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    "_pcre2_compile_16", referenced from:
    QRegularExpressionPrivate::compilePattern() in libQt5Core_debug.a(qregularexpression.o)
    "_kUTTypeBundle", referenced from:
    isPackage(QFileSystemMetaData const&, QFileSystemEntry const&) in libQt5Core_debug.a(qfilesystemengine_unix.o)
    "_UTTypeCreatePreferredIdentifierForTag", referenced from:
    isPackage(QFileSystemMetaData const&, QFileSystemEntry const&) in libQt5Core_debug.a(qfilesystemengine_unix.o)
    "_uncompress", referenced from:
    qUncompress(unsigned char const*, int) in libQt5Core_debug.a(qbytearray.o)
    (maybe you meant: _z_uncompress)
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Showing Recent Messages
    safe_pcre2_match_16(pcre2_real_code_16 const*, unsigned short const*, int, int, int, pcre2_real_match_data_16*, pcre2_real_match_context_16*) in libQt5Core_debug.a(qregularexpression.o)

      QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    
    
    
      QRegularExpressionPrivate::doMatch(QString const&, int, int, int, QRegularExpression::MatchType, QFlags<QRegularExpression::MatchOption>, QRegularExpressionPrivate::CheckSubjectStringOption, QRegularExpressionMatchPrivate const*) const in libQt5Core_debug.a(qregularexpression.o)
    

    same link: https://forum.qt.io/topic/56147/qt-5-5-0-get-error-undefined-symbol-architecture-when-using-in-xcode-with-iphoneos/4



  • ![0_1539691617886_2629dbb8-68eb-4456-80a2-6264b8c8c296-image.png](Uploading 100%)

    sreencut of xcode build is below:

    alt text


Log in to reply