static lib link size

M

mel olonsky

Hi,

I have a very small HelloWorld application.
Then I need one class from a huge vector calculation
static library.

void main()
{
cout >> "hello";
CVector myvec;
myvec.Set(25,25,0);
myvec.GetAngle();
}


The result is a 1MB exe because the vector lib is really huge.
But shouldn't the linker be smart enough to just link the required
code instead of blowing up my application??

I generated a mapfile and see that it contains a lot of unused static
lib
functions.
Is there a way to force the linker to not add all this unused stuff.
Is this a matter of include files? As soon as I include a header file
the linker will link-in all content of this file.
Or where is the logic about this?

I'm using VS.Net 2003

I need your help
Please give me some hints
-Mel
 
J

John Carson

mel olonsky said:
Hi,

I have a very small HelloWorld application.
Then I need one class from a huge vector calculation
static library.

void main()
{
cout >> "hello";
CVector myvec;
myvec.Set(25,25,0);
myvec.GetAngle();
}


The result is a 1MB exe because the vector lib is really huge.
But shouldn't the linker be smart enough to just link the required
code instead of blowing up my application??

I generated a mapfile and see that it contains a lot of unused static
lib
functions.
Is there a way to force the linker to not add all this unused stuff.
Is this a matter of include files? As soon as I include a header file
the linker will link-in all content of this file.
Or where is the logic about this?

I'm using VS.Net 2003

I need your help
Please give me some hints
-Mel

Hint 1: ask in a group dedicated to your compiler, in this case

microsoft.public.vc.language

Hint 2: make sure you are doing a release build, not a debug build.
 
M

mel olonsky

John said:
Hint 1: ask in a group dedicated to your compiler, in this case

microsoft.public.vc.language

Hint 2: make sure you are doing a release build, not a debug build.

Thanks, I will do this.
The release build doesn't help here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,247
Latest member
crypto tax software1

Latest Threads

Top