#include <iostream>
int main() {
std::cout << "HI";
}
this is the code. after compiling it is 220kb.
I used this command : cl /EHsc main.cpp.
help me reduce the size
#include <iostream>
int main() {
std::cout << "HI";
}
this is the code. after compiling it is 220kb.
I used this command : cl /EHsc main.cpp.
help me reduce the size
You can get a huge difference by not linking statically to the runtime. In addition to the optimization flags, use
/MDto use the runtime DLL.I get the .exe size down to 11 kB.
And even if you do
it is still 11 kB, so it is not growing by 220 kB per source line. :-)