Mac under mounting configuration opencv and qt

Use Qt development under Mac OS X, you need to configure the Qt library and compiler. The compiler can only use Apple's self-developed Clang.
1, respectively, and download and install XCode Command Line Tools, after installation, Clang there.
https://developer.apple.com/downloads/
I downloaded the previous version as follows:
Here Insert Picture Description
2, download Qt and installed by default
here official website said I need to select the version of Qt depending on your version of Xcode:
Here Insert Picture Description
Below I downloaded, for example, select qtcreator4.8 and qt5.12 to download and install.
http://download.qt.io/official_releases/qtcreator/ 4.8 / 4.8.0 /, to obtain the installation package qt-creator-opensource-mac- x86_64-4.8.0.dmg.

http://download.qt.io/official_releases/qt/ 5.12 / 5.12.0 /, to obtain the installation package qt-opensource-mac-5.12.0.dmg.
qt is installed by default on the line, the following is a screenshot:
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
⚠️ here to check the MacOS
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Configuration kit:
Here Insert Picture Description

Use helloword test project:
Here Insert Picture Description

Configuration opencv

Configuration opencv and I had not the same in the windows, I tried the path of the configuration opencv cmkae compiled, no! It is not known why, but use brew install opencvdownloaded but can be configured as follows:

INCLUDEPATH += /usr/local/include
/usr/local/include/opencv
/usr/local/include/opencv2

The following need to add a module used here is just a test, display a picture, use opencv4 modules.

LIBS += -L/usr/local/lib \
 -lopencv_core \
 -lopencv_highgui \
 -lopencv_imgproc \
 -lopencv_imgcodecs \

Here Insert Picture Description
Here Insert Picture Description

Published 39 original articles · won praise 8 · views 40000 +

Guess you like

Origin blog.csdn.net/star_of_science/article/details/104340605