Huge Programs With VC++
Results 1 to 9 of 9

Thread: Huge Programs With VC++

  1. #1
    Junior Member
    Join Date
    Sep 2004
    Posts
    12

    Huge Programs With VC++

    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 ?
    One Man\'s Villain, is another man\'s HERO

  2. #2
    did you alter any of the settings? like including libraries or so?

  3. #3
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    no i did'nt ulter anything i just installed and compiled !
    One Man\'s Villain, is another man\'s HERO

  4. #4
    Banned
    Join Date
    Sep 2004
    Posts
    305
    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.

  5. #5
    try this code:

    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.

  6. #6
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    well i think this is just one of microsoft's problems !

    i should use another compiler
    One Man\'s Villain, is another man\'s HERO

  7. #7
    Senior Member
    Join Date
    Mar 2004
    Posts
    557
    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*
    If the only tool you have is a hammer, you tend to see every problem as a nail.
    (Abraham Maslow, Psychologist, 1908-70)

  8. #8
    Junior Member
    Join Date
    Sep 2004
    Posts
    12
    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 !
    One Man\'s Villain, is another man\'s HERO

  9. #9
    Senior Member
    Join Date
    Oct 2001
    Posts
    786
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •