title: Compile a static library link with standard library (static)
body: <p>I'm trying to compile a static library (let's call it library.a). This library consumes resources of standard libraries. There is some way that the library can statically link a standard library.</p>
  
  <p>I have proven something like:</p>
  
  <pre><code>g++ -c library -static-libstdc++ -o library.o
  ar rcs library.o library.a
  </code></pre>
  
  <p>But if I do so there is no link to the standard libraries.</p>
  
  <p>Then I have proved this way:</p>
  
  <pre><code>g++ library -static-stdlib -o library.o
  ar rcs library.o library.a
  </code></pre>
  
  <p>But ask me to add a main function.</p>
  
  <p>Is there any possibility of creating a static library by statically linking also standard libraries (std :: string, std :: vector, std :: cin, etc ...).</p>
  
  <p>Thanks :)</p>