title: Lib Poco: DSO missing from command line
body: <p>I get following error when linking a cmake project to poco libraries:</p>
  
  <pre><code>/usr/bin/ld: /usr/local/lib/libPocoUtil.so.60: undefined reference to symbol '_ZN4Poco4JSON6Object3setERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_7Dynamic3VarE'
  /usr/local/lib/libPocoJSON.so.60: error adding symbols: DSO missing from command line
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>What I have done:
  From github I built the latest developer Version 1.7.3</p>
  
  <pre><code>git clone https://github.com/pocoproject/poco.git
  cd poco
  mkdir cmake_build
  cd cmake_build
  cmake ..
  make
  sudo make install
  </code></pre>
  
  <p>My project has following in its CMakeLists.txt file:</p>
  
  <pre><code>...
  find_package(Poco REQUIRED Foundation Net Util JSON XML JSON)
  ...
  target_link_libraries( ${CMAKE_PROJECT_NAME}  ${Poco_LIBRARIES} )
  </code></pre>
  
  <p>Inspecting the library gives me following information:</p>
  
  <pre><code>ldd -v /usr/local/lib/libPocoJSON.so
      linux-vdso.so.1 =&gt;  (0x00007fff52ffc000)
      libPocoFoundation.so.60 =&gt; /usr/local/lib/libPocoFoundation.so.60 (0x00007fb48aafc000)
      libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb48a77a000)
      libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb48a563000)
      libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb48a19a000)
      libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb489f7d000)
      libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb489d78000)
      librt.so.1 =&gt; /lib/x86_64-linux-gnu/librt.so.1 (0x00007fb489b70000)
      libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb489867000)
      /lib64/ld-linux-x86-64.so.2 (0x00005619396e6000)
  
      Version information:
      /usr/local/lib/libPocoJSON.so:
          libgcc_s.so.1 (GCC_3.0) =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1
          libc.so.6 (GLIBC_2.4) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.14) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libstdc++.so.6 (GLIBCXX_3.4.20) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4.11) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4.9) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4.21) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (CXXABI_1.3) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      /usr/local/lib/libPocoFoundation.so.60:
          libgcc_s.so.1 (GCC_3.0) =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1
          libdl.so.2 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libdl.so.2
          librt.so.1 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/librt.so.1
          libm.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libm.so.6
          libpthread.so.0 (GLIBC_2.3.4) =&gt; /lib/x86_64-linux-gnu/libpthread.so.0
          libpthread.so.0 (GLIBC_2.3.2) =&gt; /lib/x86_64-linux-gnu/libpthread.so.0
          libpthread.so.0 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libpthread.so.0
          libc.so.6 (GLIBC_2.15) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.14) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.3.4) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.4) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.11) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.7) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.3) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libstdc++.so.6 (GLIBCXX_3.4.20) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4.11) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4.9) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4.21) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4.15) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (CXXABI_1.3) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
          libstdc++.so.6 (GLIBCXX_3.4) =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      /usr/lib/x86_64-linux-gnu/libstdc++.so.6:
          ld-linux-x86-64.so.2 (GLIBC_2.3) =&gt; /lib64/ld-linux-x86-64.so.2
          libm.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libm.so.6
          libgcc_s.so.1 (GCC_4.2.0) =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1
          libgcc_s.so.1 (GCC_3.3) =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1
          libgcc_s.so.1 (GCC_3.0) =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1
          libc.so.6 (GLIBC_2.14) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.4) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.18) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.3.4) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.3) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.17) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.3.2) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
      /lib/x86_64-linux-gnu/libgcc_s.so.1:
          libc.so.6 (GLIBC_2.14) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
      /lib/x86_64-linux-gnu/libc.so.6:
          ld-linux-x86-64.so.2 (GLIBC_2.3) =&gt; /lib64/ld-linux-x86-64.so.2
          ld-linux-x86-64.so.2 (GLIBC_PRIVATE) =&gt; /lib64/ld-linux-x86-64.so.2
      /lib/x86_64-linux-gnu/libpthread.so.0:
          ld-linux-x86-64.so.2 (GLIBC_2.2.5) =&gt; /lib64/ld-linux-x86-64.so.2
          ld-linux-x86-64.so.2 (GLIBC_PRIVATE) =&gt; /lib64/ld-linux-x86-64.so.2
          libc.so.6 (GLIBC_2.14) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.3.2) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_PRIVATE) =&gt; /lib/x86_64-linux-gnu/libc.so.6
      /lib/x86_64-linux-gnu/libdl.so.2:
          ld-linux-x86-64.so.2 (GLIBC_PRIVATE) =&gt; /lib64/ld-linux-x86-64.so.2
          libc.so.6 (GLIBC_PRIVATE) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
      /lib/x86_64-linux-gnu/librt.so.1:
          libpthread.so.0 (GLIBC_2.3.2) =&gt; /lib/x86_64-linux-gnu/libpthread.so.0
          libpthread.so.0 (GLIBC_PRIVATE) =&gt; /lib/x86_64-linux-gnu/libpthread.so.0
          libpthread.so.0 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libpthread.so.0
          libc.so.6 (GLIBC_2.3.2) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_PRIVATE) =&gt; /lib/x86_64-linux-gnu/libc.so.6
      /lib/x86_64-linux-gnu/libm.so.6:
          ld-linux-x86-64.so.2 (GLIBC_PRIVATE) =&gt; /lib64/ld-linux-x86-64.so.2
          libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
          libc.so.6 (GLIBC_PRIVATE) =&gt; /lib/x86_64-linux-gnu/libc.so.6
  </code></pre>
  
  <p>In some other projects when I got the 'DSO missing' error I put -lm and -lstdc++ to the linked libraries.
  So I tried in this case:</p>
  
  <pre><code>target_link_libraries( ${CMAKE_PROJECT_NAME}  ${Poco_LIBRARIES} -lm -lstdc++ -lpthread )
  </code></pre>
  
  <p>But no luck.</p>