Ask Your Question

MohsenHk's profile - activity

2015-12-16 14:55:43 -0600 received badge  Famous Question (source)
2015-04-07 03:39:03 -0600 received badge  Notable Question (source)
2014-11-27 20:35:44 -0600 received badge  Popular Question (source)
2013-10-21 09:45:05 -0600 commented question undefined reference to `cvLoadImage'

thank you my friend :)

2013-10-21 09:22:58 -0600 commented question undefined reference to `cvLoadImage'

thank you... libopencv-dev version: 2.3.1-7 . then I can't use any opencv2 functions?

2013-10-21 09:16:39 -0600 received badge  Editor (source)
2013-10-21 08:45:23 -0600 asked a question undefined reference to `cvLoadImage'

I installed "libopencv-dev version: 2.3.1-7" with "synaptic". when I(my os is ubuntu 12.04 32bit)

.pro:

QT       += core gui
TARGET = opencv_test1
TEMPLATE = app
SOURCES += main.cpp\
        widget.cpp
HEADERS  += widget.h
FORMS    += widget.ui

main.cpp:

#include <QtGui/QApplication>
#include "widget.h"
#include "opencv2/opencv.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    w.show();
    //---------------------------------------------------------------
    IplImage* img= cvLoadImage("/home/mrl-x200/Desktop/IR_0007.jpg");
    //cvNamedWindow("hi",CV_WINDOW_AUTOSIZE);
    //cvShowImage("hi",img);
    //---------------------------------------------------------------
    return a.exec();
}

when i ran it gave me this error:

error: undefined reference to `cvLoadImage'
error: collect2: ld returned 1 exit status

what am I should to do? thank you