user3486319
user3486319

Reputation:

Why different sizes when compiling with Visual Studio and Command Line

This is not a very technical question per se, this is mostly about a curiosity I've got, why is it that when building software with the Visual Studio when you click "Build" or "Build & Run", or you simply compile your software the generated .exe is very lightweight in comparison when using the CMD

For example, I code using the Visual Studio and it may generat a .exe of around 1.5MB, but when I compile the same single .cpp file using >CL, the output .exe may weight even the double

Why is that? Also the same dumb question applies to GNU compilers? when using cpp file.cpp the generated exe can be three times bigger than the ones with Microsoft

Upvotes: 0

Views: 442

Answers (1)

jazzdelightsme
jazzdelightsme

Reputation: 477

Visual Studio also just calls CL (and LINK). The difference is that Visual Studio is passing different options than you are. You can see what options Visual Studio is passing by examining the project properties, and/or examining the build output.

Upvotes: 3

Related Questions