Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXE Size goes way up

Status
Not open for further replies.

Infinity88

Programmer
Jun 29, 2001
6
0
0
US
NOTE: In no step along the way am I outputting DEBUG info
The setup:

I created a static library with a single, simple class in it:
Code:
class xTest
{
 int Test() { return 1; }
}
I compile the LIB file and all is well. Then I create a Win32 project which imports my xTest.lib. It does a few things, but the worth noting part is when I do this:

Code:
xTest *xt;

If I don't use that xt var, and compile the exe (no debug info), it comes out to about 68k, acceptable. HOWEVER, if I do nothing more than change the above line to:

Code:
xTest *xt = new xTest();

And compile, the exe is now 680K!! Note that no where else in the program do I use the new operator.

I've been fishing around in the link settings, debug settings, etc, for the last 4 hours and NOTHING effects the exe size. What is going on???? its as if somehow the new operator is pulling in libraries left and right. I could understand a minimal increase in exe size, but 680K???!?! Damn.
 
Well I fixed it... I'm not really sure what I did. I started a brand new project(s) and pasted in my code. I guess I fouled up the link settings somehow. It must have been using some debug versions of default libraries or something. Horray!

File Size: 45k, btw
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top