I am new to C++ so this is probably a simple fix, but I have not been able to run my program even after reading Stack Overflow's many posts regarding openCV and Qt creator. This is now my 4th day trying to get openCV working in Qt creator, so any help would be greatly appreciated!
I know openCV is installed and working on my computer because I am able to build and run programs using it by running g++ pkg-config --libs --cflags opencv -o name name.cpp
in terminal, just as long as I don't try to use openCV in Qt creator. I installed openCV through Homebrew and downloaded Qt creator from its website. I also have qt installed by running "brew install qt" in terminal.
I tried linking openCV to my Qt project by editing the project file which now reads:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = opencvTestQT2
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
QT_CONFIG -= no-pkg-config
CONFIG += link_pkgconfig
PKGCONFIG += opencv
But upon trying to run it I get the error:
opencv development package not found
I have also tried adding to my project file lines such as:
INCLUDEPATH += /usr/local/Cellar/opencv/2.4.11_1/include/
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10
LIBS += -L/usr/local/Cellar/opencv/2.4.11_1/lib -lopencv_imgcodecs -lopencv_highgui
but none of them allow my program to be built.
I am using a Mac running version 10.10.4, openCV 2.4, and Qt Creator 3.4.2 in case that helps.
Thanks in advance