• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How do I decrease the size of .exe files produced by Dev-C++

NTB

Diamond Member
I've turned on Best Optimization and left out the debugging info, and even the simplest programs (ie "Hello World") still weigh in at ~440K. What's up with that?

Nate
 
just simple console stuff right now...I'm used to working in Borland Turbo C++ (from my classes over the last year), and console/DOS stuff was all we did. Don't ask me why 😛. But Borland produced .exe's somewhere around 1/10 this size, if I remember correctly.

While I'm at it, it seems that some of the functions we used regularly in Borland don't work in DEV. Specifically: clrscr() and gotoxy(). I haven't had a chance to find any others yet. Do you have any idea how I can get these to work (or what the DEV equivalent is?)

Nate
 
strip -s hello.exe

There is no standard implementation of gotoxy() or clrscr(). You either have to get a 3rd-party graphics library or muck around with ANSI escape sequences.
 
Originally posted by: PrincessGuard
strip -s hello.exe

There is no standard implementation of gotoxy() or clrscr(). You either have to get a 3rd-party graphics library or muck around with ANSI escape sequences.

Thanks for the info on the functions 😀. Now, where do I put that command line option? I tried to stick it in both the compiler and then the linker(under tools-->compiler options). One worked, the other didn't, and I still ended up with a 440K program.

Nate
 
strip is an actual program - you start it from the command line. it strips debugging info from the executable file. another option, would be to select release build from the build menu. that would accomplish the same result, with addition of optimizing the executable.
 
Originally posted by: Argo
strip is an actual program - you start it from the command line. it strips debugging info from the executable file. another option, would be to select release build from the build menu. that would accomplish the same result, with addition of optimizing the executable.

Thanks for clearing that up. I really appreciate all the help 🙂.

I figured out what to do about the getch() function too - I was using it just to stop execution so the console wouldn't close, not for actual input, so I can use this instead:

system("pause")

and I can use this instead of clrscr():

system("cls")

I realize that these are windows-specific functions, and that I'll have to figure something else out if I want to work on another OS, but they'll work for now. :

Nate
 
Back
Top