Why are binaries/executables so large on Windows?
    Tristam MacDonald 
    swiftcoder at gmail.com
       
    Fri Jul 20 11:00:26 PDT 2007
    
    
  
This is primarily because the current setup has the exututabe linked against a static runtime library. I am not sure about Windows, but on most platforms the C and C++ runtime libraries are dynamically linked, which makes the executables a lot smaller.
The test.obj is about the size your executable would be with static linking to the runtime.
There is no reason why you couldn't compile a dynamic version of the library, and link to that instead (and in fact, several people on this mailing list have done it already - use the search)., although this may be somewhat more complicated on Windows than on Mac/Unix
rpgfan3233 Wrote:
> Some thing as simple as:
> 
> void main ()
> {
> }
> 
> generates a 75kb executable with dmd 1.018 using the following line:
> dmd -O -release test.d
> 
> Does anybody know why this happens? The one thing that prevents me from using D is the large size of the generated files.
> 
> Here are the sizes of the files generated by the compiler:
> test.obj - 395 bytes
> test.map - 2390 bytes
> test.exe - 76828 bytes
> 
> Is Microsoft's OMF naturally large? Are runtime type checks to blame?
> 
> If anybody could help or explain this to me, it would be greatly appreciated.
    
    
More information about the Digitalmars-d
mailing list