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..
Now, before I get burned, I have seen: How can I get my very large program to link? 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?
VS options are: (Debug)
/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
(Release)
/O2 /D "WIN32" /D "NDEBUG" /D "_LIB" /D "_WIN32_WINNT=0x0500" /D "_MBCS" /FD /EHsc /MD /W4 /nologo /c /Wp64 /Zi /TP /errorReport:prompt
Any comments or pointers are much appreciated..