Make Qt work on apple Silicon
-
@Justinxiang See https://bugreports.qt.io/browse/QTBUG-85279
It is planed for Qt6.2 -
@Justinxiang You could try to build Qt by yourself which is not an easy task
-
@Justinxiang Did u solve this problem by build Qt for arm64?
I encounter same problem when I use opencv lib... -
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 += arm64SOURCES +=
main.cpp
opencvmain.cppHEADERS +=
opencvmain.hFORMS +=
opencvmain.uiINCLUDEPATH += -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
LIBS +=pkg-config --cflags --libs opencv4
LIBS += -framework CoreFoundation
LIBS += -framework IOKitLIBS += -L/opt/homebrew/Cellar/opencv/4.5.2_4/lib
-lopencv_core
-lopencv_highgui
-lopencv_imgproc
-lopencv_coreQT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
PKGCONFIG += opencv4 -
@Rukshan said in Make Qt work on apple Silicon:
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. -
@Rukshan said in Make Qt work on apple Silicon:
could you please recommend a resource that I can follow to build and run opencv
https://docs.opencv.org/master/d0/db2/tutorial_macos_install.html