Ask Your Question
0

Qt Error : main.o: undefined reference to symbol '_ZN2cv6String10deallocateEv'

asked 2015-03-21 10:18:38 -0600

Dezintegrator gravatar image

I have just installed opencv. (ubuntu 14.04) . I am trying run the example, but i have got error:

warning: libopencv_core.so.3.0, needed by //usr/local/lib/libopencv_imgcodecs.so, may conflict with libopencv_core.so.2.4 error: main.o: undefined reference to symbol '_ZN2cv6String10deallocateEv' /usr/local/lib/libopencv_core.so.3.0:-1: : error adding symbols: DSO missing from command line :-1: ошибка: collect2: error: ld returned 1 exit status

Please, help me to solve this proplem

there are *pro and cpp files:

//------------------------------------------------------------------------------------------------------------------------------------------------------ QT += core gui \ multimedia \ multimediawidgets

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = opencv_examples

TEMPLATE = app

INCLUDEPATH += /usr/local/include/highgui \ /usr/local/include/imgcodecs \ LIBS += -lopencv_imgcodecs \ -lopencv_highgui \ -lopencv_core SOURCES += main.cpp

//---------------------------------------------------------------------------------------

{

include "opencv2/opencv.hpp"

include "opencv2/core/core.hpp"

include "opencv2/highgui/highgui.hpp"

include "iostream"

using namespace cv; using namespace std;

int main( int argc, char** argv ) {

Mat image;
image = imread("/home/imgs/lena.png");   // Read the file

if(! image.data )                              // Check for invalid input
{
    cout <<  "Could not open or find the image" << std::endl ;
    return -1;
}

namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image );                   // Show our image inside it.

waitKey(0);                                          // Wait for a keystroke in the window

return 0;

}

}

edit retag flag offensive close merge delete

Comments

I moved libopencv_core.so.2.4 to anover folder, but have this error

Dezintegrator gravatar imageDezintegrator ( 2015-03-21 10:59:55 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2015-03-21 11:49:17 -0600

Dezintegrator gravatar image

The problem has gone I add this into *.pro file

LIBS += -L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_highgui

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-03-21 10:18:38 -0600

Seen: 14,763 times

Last updated: Mar 21 '15