I recently installed Qt Creator and OpenCv. I was able to quietly compile the separate QT and OpenCv. But I can not compile them together. My .pro
file looks like this:
#-------------------------------------------------
#
# Project created by QtCreator 2015-06-27T12:52:47
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Older
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib \
-lopencv_core \
-lopencv_imgproc \
-lopencv_highgui \
-lopencv_objdetect \
-lopencv_calib3d
QMAKE_CXXFLAGS+=-std=c++11
QMAKE_CXXFLAGS+=-stdlib=libc++
QMAKE_LFLAGS+=-std=c++11
QMAKE_LFLAGS+=-stdlib=libc++
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
The problem is that if I leave the main.cpp file this way compiles normally:
#include "mainwindow.h"
#include <QApplication>
#include <opencv2/opencv.hpp>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
If I add this single line I get the error "error: symbol (s) not found for x86_64 architecture" :
cv::Mat inputImage = cv::imread("/Users/pedrosoares/TESTEOpenCV/fefafofauroFex.png");
I've done everything, everything is kind of forum but none worked on my mac.