By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,114 Members | 992 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,114 IT Pros & Developers. It's quick & easy.

static lib link size

P: n/a
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
Dec 26 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"mel olonsky" <me*********@gmx.netwrote in message
news:b0***************************@news.inode.at
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.
--
John Carson
Dec 26 '06 #2

P: n/a
John Carson wrote:
"mel olonsky" <me*********@gmx.netwrote in message
news:b0***************************@news.inode.at
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.
Thanks, I will do this.
The release build doesn't help here.
Dec 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.