I installed OpenCV to Ubuntu 14.04. I'm trying to fallow tutorials at opencv website. I got an error while running this code. I'm using eclipse to run the code. I'm getting this error while building project. I added, opencv_core, opencv_highgui,opencv_imgcodecs libraries to g++ linker.
Error message:
//usr/local/lib/libopencv_imgproc.so.3.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [optest01] Error 1
Code :
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
using namespace cv;
/// Global variables
Mat src, src_gray;
Mat dst, detected_edges;
/** @function main */
int main( int argc, char** argv )
{
/// Load an image
src = imread( "/images/Lenna.jpg" );
if( !src.data )
{ return -1; }
/// Create a matrix of the same type and size as src (for dst)
dst.create( src.size(), src.type() );
/// Convert the image to grayscale
cvtColor( src, src_gray, COLOR_BGR2GRAY );
return 0;
}
Your error code:
//usr/local/lib/libopencv_imgproc.so.3.0: error adding symbols: DSO missing from command line
is telling you that you haven't linked opencv_imgproc
.
Just link the required library:
-lopencv_imgproc
I had the similar problem DSO missing from command line
and adding the -L/usr/local/lib
in front solved the problem for me i.e. g++ source_code.cpp -o output_name -L/usr/local/lib <dependent libraries e.g. -lopencv_highgui>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With