Opencv, DSO missing from command line collect2: error: ld returned 1 exit status
<p>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.</p>

<pre><code>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></pre>

<p>Code :</p>

<pre><code>#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;

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;
  }
</code></pre>