I'm having a problem with VC++,
every time i compile a program even the smallest one i end up with a 100 KB or more !!!!
any solution ?
Printable View
I'm having a problem with VC++,
every time i compile a program even the smallest one i end up with a 100 KB or more !!!!
any solution ?
did you alter any of the settings? like including libraries or so?
no i did'nt ulter anything i just installed and compiled !
No big issue...
As in my picture... I have a tiny program, simply prints out "Hello world!" but the dependency on libraries and using namespace dumps a lot of data into the .exe... see http://home.arcor.de/e-h-s/tips/minexe/minexe.html for more references.
try this code:
this will give a normal sized program.Code:#include <stdio.h>
int main(void)
{
printf("Hello World!");
return 0;
}
i don't know why it is that big with your code, i have tried altering it, but it still stays big 400+ kb.
but i'm not a C++ coder, i just know C, and the above code is C, the only advantage is that you can use it in a cpp file also.
well i think this is just one of microsoft's problems !
i should use another compiler
That's not an explanation - compiling lepricauns codeQuote:
well i think this is just one of microsoft's problems !
I get a executable of 40kb using VC++.
Adding 10 somewhat complex statements,
I get an executable of 41kb. Both sizes are reasonable.
It's not just one of microsoft's problems. However,
I never actually tried to minimize the size of executables
(I just know that option: "optimize for ... minimal size",
and therefore cannot help you. sorry.
/edit:
switching to another compiler might not help you much.
I tried on a linux machine with gcc the above example:
-rwxr-xr-x 1 abcdefgh abcd 515K Oct 22 12:54 prog*
ok
any way i'm using now DEV_CPP it is very good and it is compiling every C & C++ Code I'm giving it !
VC++ usually compiles a Debug build that includes a lot of bloat. Compile a Release build and it would strip a lot of the debugging info out and probably make a smaller executable.
Although I do remember my VC++ making huge 200KB+ executables for Hellow World. Which is why I liked DevC++ better. Cheers.