title: Ubuntu how to link g2o using cmake /usr/bin/ld: cannot find -lg2o_core_d
body: <p>When I run <code>make</code> I get this output. How do I link the g2o library using cmake. CMake doesn't have an issue writing build files.</p>
  
  <pre><code>[  7%] Linking CXX executable proj1
  /usr/bin/ld: cannot find -lg2o_core_d
  /usr/bin/ld: cannot find -lg2o_types_slam3d_d
  /usr/bin/ld: cannot find -lg2o_solver_csparse_d
  /usr/bin/ld: cannot find -lg2o_stuff_d
  /usr/bin/ld: cannot find -lg2o_csparse_extension_d
  /usr/bin/ld: cannot find -lg2o_types_sba_d
  collect2: error: ld returned 1 exit status
  CMakeFiles/proj1.dir/build.make:425: recipe for target 'proj1' failed
  make[2]: *** [vo] Error 1
  CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/proj1.dir/all' failed
  make[1]: *** [CMakeFiles/proj1.dir/all] Error 2
  Makefile:83: recipe for target 'all' failed
  make: *** [all] Error 2
  </code></pre>
  
  <p>Here is my CMakeLists.txt file</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.0)
  project(proj1)
  
  set(CMAKE_CXX_STANDARD 11)
  
  set(SOURCE_FILES
          include1.hpp
          include2.hpp
          include3.hpp)
  
  find_package( OpenCV REQUIRED )
  find_package( Eigen3 REQUIRED )
  include_directories( include ${OpenCV_INCLUDE_DIRS} )
  include_directories( include ${Eigen_INCLUDE_DIRS} ${Boost_INCLUDE_DIR})
  add_executable( proj1 ${SOURCE_FILES} )
  target_link_libraries( proj1
          ${OpenCV_LIBS}
          ${Eigen_LIBS}
  
           g2o_core_d
           g2o_types_slam3d_d
           g2o_solver_csparse_d
           g2o_stuff_d
           g2o_csparse_extension_d
           g2o_types_sba_d
  
           g2o_core
           g2o_types_slam3d
           g2o_solver_csparse
           g2o_stuff
           g2o_csparse_extension
           g2o_types_sba
  
          )
  </code></pre>