title: boost iostreams library exist but i am unable link it
body: <p>I know that the re plenty of similar questions, but mine is litle bit different and non them helped me.</p>
  
  <p>I am using boost-iostreams library and here is my problem, i tried to link my program with libraries:</p>
  
  <pre><code>ld -I/usr/include/boost/iostreams/ -I/usr/include/boost/iostreams/device/  -L/usr/lib/libboost_iostreams.so -lboost-iostreams fd.o -o x 
  </code></pre>
  
  <p>And the result was:</p>
  
  <pre><code>ld: cannot find -lboost-iostreams
  </code></pre>
  
  <p>When i tried to write it explicitly:</p>
  
  <pre><code>ld -I/usr/include/boost/iostreams/ -I/usr/include/boost/iostreams/device/  --library /usr/lib/libboost_iostreams.so -lboost-iostreams fd.o -o x
  </code></pre>
  
  <p>It told me that the library dont exist:</p>
  
  <pre><code>ld: cannot find -l/usr/lib/libboost_iostreams.so
  ld: cannot find -lboost-iostreams
  </code></pre>
  
  <p>But it does:</p>
  
  <pre><code>$ ls -l /usr/lib/libboost_iostreams*
  -rw-r--r-- 1 root root 204682 feb  4 05:28 /usr/lib/libboost_iostreams.a
  lrwxrwxrwx 1 root root     20 feb  4 05:28 /usr/lib/libboost_iostreams-mt.a -&gt;         libboost_iostreams.a
  lrwxrwxrwx 1 root root     28 feb  4 05:28 /usr/lib/libboost_iostreams-mt.so -&gt;  libboost_iostreams.so.1.49.0
  lrwxrwxrwx 1 root root     28 feb  4 05:28 /usr/lib/libboost_iostreams.so -&gt; libboost_iostreams.so.1.49.0
  -rw-r--r-- 1 root root  94280 feb  4 05:28 /usr/lib/libboost_iostreams.so.1.49.0
  </code></pre>
  
  <p>About me:</p>
  
  <ul>
  <li>OS: Debian 7 Wheezy </li>
  <li>prog. lang.: c++</li>
  <li>compiler: g++ (Debian 4.7.2-5) 4.7.2</li>
  <li>linker: GNU ld (GNU Binutils for Debian) 2.22</li>
  <li>boost library ver.: 1.49 ( from debian repo )</li>
  </ul>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The right option should be <code>-lboost_iostreams</code>, not <code>-lboost-iostreams</code></p>
  
  <p><strong>EDIT2:</strong></p>
  
  <p>After edit my command was:</p>
  
  <pre><code>ld fd.o -I/usr/include/boost/iostreams/ -I/usr/include/boost/iostreams/device/ -o x $(LIB_PATH) -lboost_iostreams
  </code></pre>
  
  <p>Where libpath is ONE of following:</p>
  
  <pre><code>LIB_PATH=
  LIB_PATH=-L/usr/lib/
  LIB_PATH=/usr/lib/libboost_iostreams.so
  LIB_PATH=/usr/lib/libboost_iostreams.a
  </code></pre>
  
  <p>but the result is still:</p>
  
  <pre><code>ld: warning: cannot find entry symbol _start; defaulting to 000000000804cc10
  fd.o: In function `__static_initialization_and_destruction_0(int, int)':
  fd.cpp:(.text+0xd6): undefined reference to `__dso_handle'
  ld: x: hidden symbol `__dso_handle' isn't defined
  ld: final link failed: Bad value
  make: *** [x] Error 1
  </code></pre>