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

Qt6 Static build for macOS problem: Undefined symbols for architecture x86_64 and issues with libraries linking.



  • Hi all

    I have some issues while compiling QML project (qmake) under Qt6 Static build. The compilations process exits with code 2 and reporting "Undefined symbols for architecture x86_64".

    Further analisys of compile output shows number of issues, which seems to be libraries/plugins linking to Static build:

    *Undefined symbols for architecture x86_64:
      "qml_register_types_QtQuick_Layouts()", referenced from:
          qt_plugin_instance_QtQuickLayoutsPlugin() in libqquicklayoutsplugin.a(plugin.cpp.o)
      "qml_register_types_Qt_labs_settings()", referenced from:
          qt_plugin_instance_QmlSettingsPlugin() in libqmlsettingsplugin.a(plugin.cpp.o)
    ...
    ...
    ...
    libqtvirtualkeyboard_pinyin.a(pinyindecoderservice.cpp.o)
      "_im_set_max_lens", referenced from:
          QtVirtualKeyboard::PinyinDecoderService::setLimits(int, int) in libqtvirtualkeyboard_pinyin.a(pinyindecoderservice.cpp.o)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [ATU_connect.app/Contents/MacOS/ATU_connect] Error 1
    21:53:54: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project ATU_connect (kit: 6.1.0_static)
    When executing step "Make"*
    

    I have tested (with the same resuilt) on Static builds of Qt versions 6.0.3 and 6.1.0-beta3 and under Xcode 12.0 and 12.4.

    full compile output log attached
    static configuration log attached

    Edit:
    Logs seems to be not attaching to the post. Those can be found here:
    Compile output log: http://vk6nx.net/files/compile_output.txt
    Static config log: http://vk6nx.net/files/configuration.txt

    Static Build environment:
    macOS Catalina 10.15.17

    Static Build Qt versions:
    6.0.3 and 6.1.0-beta3

    Xcode environment
    Xcode_12.4
    Command_Line_Tools_for_Xcode_12.4

    % xcode-select -print-path
    /Applications/Xcode.app/Contents/Developer

    % xcrun -sdk macosx -find clang
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

    % xcrun -sdk macosx --show-sdk-path
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk

    Static Build system:
    ninja

    Please note that the same application is successfully compiling under following dynamic Qt versions: 6.0.3, 6.1.0-beta3 and static Qt version 5.15.2.

    Please note: if Static (6.0.3 or 6.1.0-beta3) is build with configuration key -shared, then application is successfully compiling (but, obviously, it is non static application).

    Any suggestions would be really appreciated.

    Thanks in advance.



  • FYI
    After further steps ithe issue was recognised as the bug.

    Fix:
    https://bugreports.qt.io/browse/QTBUG-93021


Log in to reply