Click to See Complete Forum and Search --> : Huge Programs With VC++
B@d_$ector
October 15th, 2004, 12:39 PM
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 ?
lepricaun
October 15th, 2004, 12:41 PM
did you alter any of the settings? like including libraries or so?
B@d_$ector
October 17th, 2004, 05:48 PM
no i did'nt ulter anything i just installed and compiled !
;TT
October 17th, 2004, 05:58 PM
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.
lepricaun
October 17th, 2004, 09:52 PM
try this code:
#include <stdio.h>
int main(void)
{
printf("Hello World!");
return 0;
}
this will give a normal sized program.
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.
B@d_$ector
October 22nd, 2004, 12:16 PM
well i think this is just one of microsoft's problems !
i should use another compiler
sec_ware
October 22nd, 2004, 12:32 PM
well i think this is just one of microsoft's problems !
That's not an explanation - compiling lepricauns code
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*
B@d_$ector
October 24th, 2004, 01:50 PM
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 !
Tim_axe
October 24th, 2004, 08:48 PM
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.