title: Compiling libPNG DLL with MinGW - large import library
body: <p>I am trying to compile libPNG with MinGW-gcc under windows.</p>
  
  <p>First I compile the sources:</p>
  
  <pre><code>gcc -c -O3 src\*.c
  </code></pre>
  
  <p>Then for making a static library:</p>
  
  <pre><code>ar rvs lib\libpng.a *.o
  </code></pre>
  
  <p>I get a <code>.a</code> static library which is 273kB large. Fine</p>
  
  <p>Then I try to make a DLL version:</p>
  
  <pre><code>g++ -shared -o bin\libpng.dll *.o -lz -Wl,--out-implib,lib\libpng.dll.a
  </code></pre>
  
  <p>I get a DLL which is 366kB  (fine) and an import lib which is 272kB large.</p>
  
  <p>Usually, import libraries are very small (such as 5kB), for instance I have compiled OpenEXR in both static and dynamic flavors, the size of the static .a is similar to the size of the DLL (1.5 ratio) and the dynamic .a is very small (few kBs)</p>
  
  <p>Is everything normal, or is something wrong?</p>