title: Undefined reference to symbol but library is linked
body: <p>I am trying to build an application with opencv 3.0 and I get an "undefined reference to symbol error"</p>
  
  <p>My problem is that the symbol is defined within the libraries I am linking to.</p>
  
  <p>Compile command:</p>
  
  <pre><code>g++ -o DisparityMap main.o tools.o emb.o moc_tools.o moc_emb.o -lopencv_highgui -lopencv_core -lopencv_imgproc -lopencv_imgcodecs -lopencv_calib3d -lQtGui -lQtCore -lpthread
  </code></pre>
  
  <p>The error I get:</p>
  
  <pre><code>/usr/bin/ld: twowindow.o: undefined reference to symbol '_ZN2cv6String10deallocateEv'
  //usr/local/lib/libopencv_core.so.3.0: error adding symbols: DSO missing from command line
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>But the symbol in question is actually defined within the libraries I link to:</p>
  
  <pre><code>scanelf -l -s _ZN2cv6String10deallocateEv | grep _ZN2cv6String10deallocateEv
  
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_objdetect.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_photo.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_core.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_video.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_features2d.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_ml.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_highgui.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_videoio.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_stitching.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_videostab.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_superres.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_flann.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_imgproc.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_imgcodecs.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_calib3d.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_shape.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_objdetect.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_photo.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_core.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_video.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_features2d.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_ml.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_highgui.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_videoio.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_stitching.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_videostab.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_superres.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_flann.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_imgproc.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_imgcodecs.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_calib3d.so.3.0.0 
  ET_DYN _ZN2cv6String10deallocateEv /usr/local/lib/libopencv_shape.so.3.0.0 
  </code></pre>