将OpenCV链接到Qt Creator [英] Linking OpenCV to Qt Creator
问题描述
我正在尝试在QT创建者中使用opencv 4,我在Mac上工作但我无法链接该库,总是出现如图2所示的错误.
I'm trying to use opencv 4 in QT creator, I'm working on Mac but I can't be able to link the library, I always have a error like on picture 2.
请帮助我,我真的很绝望.
please help me, I'm really hopeless.
推荐答案
所以,我在这里有一个解决方案,我已经安装了OpenCV 4.在
So, I have a solution here, I have install the OpenCV 4. In
/usr/local/Cellar/opencv/4.2.0_1/lib/pkgconfig
/usr/local/Cellar/opencv/4.2.0_1/lib/pkgconfig
我有一个opencv4.pc而不是opencv.pc,"opencv开发包未找到"错误是从这里发出的.
I have a opencv4.pc not opencv.pc and the "opencv development package not found" error came from here.
使用
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
PKGCONFIG += opencv4
请注意,它是opencv4.
note that it's opencv4.
必须正常配置Qt Creator中的构建环境之后.
after you have to configure the Build Environment in Qt Creator normally.
这篇关于将OpenCV链接到Qt Creator的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!