Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

undefined reference to `cvLoadImage'!!!

I installed "opencv" 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

click to hide/show revision 2
retagged

updated 2013-10-21 08:53:20 -0600

berak gravatar image

undefined reference to `cvLoadImage'!!!

I installed "opencv" 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

click to hide/show revision 3
No.3 Revision

updated 2013-10-21 08:57:10 -0600

berak gravatar image

undefined reference to `cvLoadImage'!!!`cvLoadImage'

I installed "opencv" 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

undefined reference to `cvLoadImage'

I installed "opencv" "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