building for macOS-arm64 but attempting to link with file built for macOS-x86_64
-
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 withninja
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?
-
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.
-
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.
@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?
-
@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?
@paulmasri which version of Qt 5 are you using ?