title: Link one shared library static to my shared library
body: <p>I am struggeling a little bit with some options for linking on a project I am currently working on:</p>
  
  <p>I am trying to create a shared library which is linked against 2 other libraries. (Lets call them <code>libfoo.so</code> and <code>libbar.so</code>)<br>
  My output library has to be a shared library and I want to static link <code>libfoo.so</code> to the resulting library, but <code>libbar.so</code> should linked as a dynamic library. (<code>libbar.so</code> should be available on every machine, where <code>libfoo.so</code> is not available and I do not want the user install it / ship it with my binaries.) </p>
  
  <p>How could I archive this?</p>
  
  <p>My current build instruction look like this:</p>
  
  <pre><code>c++ -Wall -shared -c -o src/lib.o src/lib.cpp
  c++ -Wall -shared -o lib.ndll src/lib.o -lfoo -lbar
  </code></pre>
  
  <p>I my defense: I am not a c/c++ expert, so sorry if this question seems to be stupid.</p>