Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Forum Updated to NodeBB v4.3 + New Features

building for macOS-arm64 but attempting to link with file built for macOS-x86_64

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.6k 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.
  • D Offline
    D Offline
    D300
    wrote on last edited by D300
    #1

    Hey,

    i´m on an mac m1 with arm64.

    due to compatibility with this ( https://github.com/GENIVI/CANdevStudio ) i need to use QT version 5.12. only with that version i could generate the build files.
    when i now follow the instructions and build with ninja the build failes as follows:

    FAILED: src/components/canload/canloadmodel_test 
    : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names  src/components/canload/CMakeFiles/canloadmodel_test.dir/canloadmodel_test_autogen/mocs_compilation.cpp.o src/components/canload/CMakeFiles/canloadmodel_test.dir/tests/canloadmodel_test.cpp.o -o src/components/canload/canloadmodel_test -F/Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib -Wl,-rpath,/Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib  src/components/canload/libcanload.a  /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtTest.framework/QtTest  src/common/libcds-common.a  /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtSerialBus.framework/QtSerialBus  3rdParty/nodeeditor/libnodes.a  /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtOpenGL.framework/QtOpenGL  3rdParty/CANdb/src/libCANdb.a  /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtSvg.framework/QtSvg  /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtWidgets.framework/QtWidgets  /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtGui.framework/QtGui  /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtCore.framework/QtCore && :
    ld: warning: ignoring file /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtTest.framework/QtTest, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtSerialBus.framework/QtSerialBus, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtOpenGL.framework/QtOpenGL, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtSvg.framework/QtSvg, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtWidgets.framework/QtWidgets, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtGui.framework/QtGui, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    ld: warning: ignoring file /Users/dirkhandreke/Qt5.12.0/5.12.0/clang_64/lib/QtCore.framework/QtCore, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
    Undefined symbols for architecture arm64:
      "qRegisterResourceData(int, unsigned char const*, unsigned char const*, unsigned char const*)", referenced from:
          qInitResources_resources() in libnodes.a(qrc_resources.cpp.o)
      "qUnregisterResourceData(int, unsigned char const*, unsigned char const*, unsigned char const*)", referenced from:
          qCleanupResources_resources() in libnodes.a(qrc_resources.cpp.o)
      "qHash(QUuid const&, unsigned int)", referenced from:
          std::__1::hash<QUuid>::operator()(QUuid const&) const in libnodes.a(FlowScene.cpp.o)
          std::__1::hash<QUuid>::operator()(QUuid const&) const in libnodes.a(NodeState.cpp.o)
      "qHash(QString const&, unsigned int)", referenced from:
          QtNodes::ConnectionStyle::normalColor(QString) const in libnodes.a(ConnectionStyle.cpp.o)
          std::__1::hash<QString>::operator()(QString const&) const in libnodes.a(DataModelRegistry.cpp.o)
      "qBadAlloc()", referenced from:
          QVector<int>::reallocData(int, int, QFlags<QArrayData::AllocationOption>) in canloadmodel_test.cpp.o
      "QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)", referenced from:
          QTypedArrayData<unsigned short>::deallocate(QArrayData*) in canloadmodel_test.cpp.o
          QTypedArrayData<char>::deallocate(QArrayData*) in canloadmodel_test.cpp.o
          QTypedArrayData<int>::deallocate(QArrayData*) in canloadmodel_test.cpp.o
          QTypedArrayData<unsigned short>::deallocate(QArrayData*) in libcanload.a(canloadmodel.cpp.o)
          QTypedArrayData<char>::deallocate(QArrayData*) in libcanload.a(canloadmodel.cpp.o)
          QTypedArrayData<char>::deallocate(QArrayData*) in libcanload.a(mocs_compilation.cpp.o)
          QTypedArrayData<unsigned short>::deallocate(QArrayData*) in libcanload.a(mocs_compilation.cpp.o)
    

    right now i´m setting up the same dev environment on a x86 and will see if this is the problem...

    if not how could i get this to build?

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

      Hi and welcome to devnet,

      Qt 5.12 dates from a time where the M1 was not yet available and this is only built for x86. So either you try to build that version yourself knowing that it is not an officially supported architecture or you can try to work for example from a command line configured to run in x86-64 mode using the arch command.

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

      P 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        Qt 5.12 dates from a time where the M1 was not yet available and this is only built for x86. So either you try to build that version yourself knowing that it is not an officially supported architecture or you can try to work for example from a command line configured to run in x86-64 mode using the arch command.

        P Offline
        P Offline
        paulmasri
        wrote on last edited by
        #3

        @SGaist I've hit this problem too. I can compile Qt 6 but not Qt 5 on my Apple Silicon.

        I'm working in Qt Creator and not building from the command line (read: not as familiar with command line).

        How do I configure build settings or kits in Qt Creator to run Qt 5 builds in x86-64 mode?

        SGaistS 1 Reply Last reply
        0
        • P paulmasri

          @SGaist I've hit this problem too. I can compile Qt 6 but not Qt 5 on my Apple Silicon.

          I'm working in Qt Creator and not building from the command line (read: not as familiar with command line).

          How do I configure build settings or kits in Qt Creator to run Qt 5 builds in x86-64 mode?

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @paulmasri which version of Qt 5 are you using ?

          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

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved