Reputation: 385
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?
Upvotes: 0
Views: 1060
Reputation: 49
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...
Upvotes: 0
Reputation: 385
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!
Upvotes: 1
Reputation: 4077
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:
CONFIG += link_pkgconfig
PKGCONFIG += opencv
Upvotes: 1
Reputation: 3131
try to add the filename of the lib to the path. LIBS += /Library/Frameworks/OpenCV/lib/opencv.lib
Upvotes: 0