Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Make Qt work on apple Silicon
I'm pretty new to Qt and development so I apologize if some questions may seem irrelevant.
I am working on a Mac with arm64 architecture and I need Qt for education purposes. More precisely, my teacher wants us to use his library which uses Qt.
First I tried to just download Qt and the library normally hoping that Rosetta 2 will do the job for me but it didn't work when I tried to build a project. Then I installed the library from source and there I had warning and errors involving Qt like "ld: warning: ignoring file /.../5.15.2/lib/QtOpenGL.framework/QtOpenGL, building for macOS-arm64 but attempting to link with file built for macOS-x86_64"
"Undefined symbols for architecture arm64:
"qBadAlloc()", referenced from:
QVector<QPointF>::realloc(int, QFlagsQArrayData::AllocationOption) in libImagineGraphics.a(Draw.cpp.o) »
I did not find any information I could understand about Qt on Apple silicone so I tried to build it from source. It took several hours and didn't work in the end.
Let me know if it is not the place for this type of questions.
Thank you for your help !
Hi and welcome to devnet,
Did you check already with Qt 6 ?
@SGaist Thank you for your help ! I tried to install the Qt6 binaries but I had the same problems.
Do you want me to build Qt6 from source files ?
The support isn't there quite yet, but it's worked on.
You can check here:
For current progress, and what you can do yourself of right now, to make it work, apparently building Qt yourself my work 🤷♂️
@J-Hilk Thank you for your answer ! Unfortunately I can’t manage to build qt by myself, I think I will wait for now ...
roilev last edited by
This post is deleted!
hey I wonder did you solve this problem?becasu i 'm running qt on my apple m1 as well, and obviously, it didn't work very well
@jsulm oh thank u, i suppose i need to wait for a time :(
but i'd like to know do you have any other temporary way to run qt on arm64 mac?
@Justinxiang You could try to build Qt by yourself which is not an easy task
@jsulm ok, I got your idea, thank u for your reply :)
KJC94 last edited by
@Justinxiang Did u solve this problem by build Qt for arm64?
I encounter same problem when I use opencv lib...
Is there a solution for this issue. I have Qt6, but the issue persists.
This is the code in .pro. I used homebrew to install opencv4.
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
CONFIG += arm64
INCLUDEPATH += -I/opt/homebrew/Cellar/opencv/4.5.2_4/include/opencv4
INCLUDEPATH += -I/opt/homebrew/Cellar/opencv/4.5.2_4/lib
INCLUDEPATH += -I/opt/homebrew/Cellar/opencv/4.5.2_4/bin
pkg-config --cflags --libs opencv4
LIBS += -framework CoreFoundation
LIBS += -framework IOKit
LIBS += -L/opt/homebrew/Cellar/opencv/4.5.2_4/lib
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
PKGCONFIG += opencv4
Is there a solution for this issue
What issue do you mean? Qt built for x86_64?
There is no official M1 ARM builds of Qt yet.
You can either build Qt by yourself or use OpenCV x86_64 build.
Thanks for the replay. I have a Mac M1 and I cannot build. I get the following error.
ld: warning: ignoring file /opt/homebrew/Cellar/opencv/4.5.2_4/lib/libopencv_alphamat.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
"cv::Mat::Mat()", referenced from:
_main in main.o
"cv::Mat::~Mat()", referenced from:
_main in main.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: *** [OpenCVDemoB.app/Contents/MacOS/OpenCVDemoB] Error 1
23:02:43: The process "/usr/bin/make" exited with code 2.
Error while building/deploying pro
If Qt does not support M1 could you please recommend a resource that I can follow to build and run opencv.
could you please recommend a resource that I can follow to build and run opencv
@jsulm Thanks I will follow the link.