title: Huge static library file when compiled using VS2005, normal size when compiled using gcc
body: <p>I'm compiling a static library that contains mainly templated classes. When this is compiled using gcc, the resulting .a file is around about the 40Mb mark. This is pretty big, but not entirely unexpected due to the amount of templating going on. However, when I compile the same code using VS2005, the resulting .lib file is coming in at (wait for it!) 575Mb..</p>
  
  <p>Now, before I get burned, I have seen: <a href="https://stackoverflow.com/questions/3307880/how-can-i-get-my-very-large-program-to-link">How can I get my very large program to link?</a> and this is useful for understanding that templates are potentially making the libs large, but I'm struggling to understand why the outputs from the two compilers are so different in size?</p>
  
  <p>VS options are:
  (Debug)</p>
  
  <pre><code>/Od /D "WIN32" /D "_DEBUG" /D "_LIB" /D "_WIN32_WINNT=0x0500" /D "_MBCS" /Gm /EHsc /RTC1 /MDd /W4 /nologo /c /Wp64 /Zi /TP /errorReport:prompt
  </code></pre>
  
  <p>(Release)</p>
  
  <pre><code>/O2 /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_WIN32_WINNT=0x0500" /D "_MBCS" /FD /EHsc /MD /W4 /nologo /c /Wp64 /Zi /TP /errorReport:prompt
  </code></pre>
  
  <p>Any comments or pointers are much appreciated..</p>