title: Creating shared and static libraries using g++ (under Windows)
body: <p>How do I create static and dynamic libraries for Windows using g++? </p>
  
  <p>I've found a few commands for Linux for creating <code>.so</code> files and I've tried to apply them on a Windows shell, but they build <code>.dll</code> files that my applications fail to link with at runtime. </p>
  
  <p>I've only managed to build <code>.dll</code> files using Visual C++ but I would like to build them manually on the command line, preferably using <code>g++</code>. I would also like to know how to build static libraries too for Windows. </p>