Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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;

}

}