集成 QT 和 OpenCV?
我尝试将 QT 和 OpenCV 与以下 .pro 集成,但仍然收到有关链接的错误。
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 6 17:34:22 2011
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT+=opengl
# Input
HEADERS += glwidget.h mainwindow.h ui_info.h ui_information.h
FORMS += mainwindow.ui
SOURCES += glwidget.cpp main.cpp mainwindow.cpp
RESOURCES += res.qrc
INCLUDEPATH += /usr/local/include/opencv
LIBS += /Library/Frameworks/OpenCV/lib
知道我能做什么吗?
I tried integrating QT and OpenCV with the following .pro but I still get errors about linking.
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 6 17:34:22 2011
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT+=opengl
# Input
HEADERS += glwidget.h mainwindow.h ui_info.h ui_information.h
FORMS += mainwindow.ui
SOURCES += glwidget.cpp main.cpp mainwindow.cpp
RESOURCES += res.qrc
INCLUDEPATH += /usr/local/include/opencv
LIBS += /Library/Frameworks/OpenCV/lib
any idea what I can do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您在此配置中缺少库名称,请指定库名称,如下所示:
LIBS += -L/usr/local/lib -lcv -lhighgui
库名称可能会随 OpenCV 版本的不同而变化,因此您必须查看 OpenCV 文档。
更简单的方法是通过在项目 .pro 文件中将 INCLUDEPATH 和 LIBS 替换为以下内容来使用 pkg-config:
you are missing library name in this configuration, specify the libs names as following:
LIBS += -L/usr/local/lib -lcv -lhighgui
Library names can change with versions of OpenCV, so you have to look at OpenCV documentation.
A simpler method will be to use pkg-config by replacing INCLUDEPATH and LIBS with the following in your project .pro file:
我终于找到了解决方案。我已经移动了我的博客,我很快就会再次发布。如果您需要的话请私信我,我会发给您!
I Finally found a solution. I Have moved my blog I will post again soon. If you need it just msg me and I will send to you!
尝试将库的文件名添加到路径中。 LIBS += /Library/Frameworks/OpenCV/lib/opencv.lib
try to add the filename of the lib to the path. LIBS += /Library/Frameworks/OpenCV/lib/opencv.lib
链接外部库(如 OpenCV)的最简单、最可靠的方法是使用 Qt Creator 中的“添加库”向导。
下面列出的步骤可在 Qt5 文档中找到: [ http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html][1] 在“添加库”部分下。
让我从此处添加一些特殊性...
The EASIEST and most SURE way to link an external library like OpenCV is to use the "Add Library" wizard inside Qt Creator.
The steps listed below are found in the Qt5 documentation: [http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html][1] under the "To Add Library" section.
Let me add some specificity from here...