Using OpenCV in QTCreator (linking problem)

Posted by Jane on Stack Overflow See other posts from Stack Overflow or by Jane
Published on 2010-04-28T14:39:57Z Indexed on 2010/04/28 14:43 UTC
Read the original article Hit count: 865

Filed under:
|

Greetings!

I have a problem with the linking simpliest test program in QTCreator:

CODE:

#include <QtCore/QCoreApplication>

#include <cv.h>

#include<highgui.h>

#include <cxcore.hpp>

using namespace cv;

int _tmain(int argc, _TCHAR* argv[])

{

cv::Mat M(7,7,CV_32FC2,Scalar(1,3));

return 0;

}

.pro file:

QT -= gui

TARGET = testopencv CONFIG += console CONFIG -= app_bundle INCLUDEPATH += C:/OpenCV2_1/include/opencv TEMPLATE = app

LIBS += C:/OpenCV2_1/lib/cxcore210d.lib \ C:/OpenCV2_1/lib/cv210d.lib \ C:/OpenCV2_1/lib/highgui210d.lib\ C:/OpenCV2_1/lib/cvaux210d.lib SOURCES += main.cpp

I've tried to use -L and -l like LIBS+= -LC:/OpenCV2_1/lib -lcxcored

ang .pri file

QMAKE_LIBDIR += C:/OpenCV2_1/lib/Debug

LIBS += -lcxcore210d \ -lcv210d \ -lhighgui210d

The errors are like

debug/main.o:C:\griskin\test\app\testopencv/../../../../OpenCV2_1/include/opencv/cxcore.hpp:97: undefined reference to cv::format(char const*, ...)'

Could anyone help me? Thanks!

In Visual Studio it works but I need it works in QTCreator..

© Stack Overflow or respective owner

Related posts about opencv

Related posts about qtcreator