473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

static lib link size

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
2 1874
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Torsten Mohr | last post by:
Hi, i'd like to build an executable file that is linked with a python library and executes a script via PyRun_SimpleString or similar functions. Is there a static library of python available,...
2
by: Egbert Nierop \(MVP for IIS\) | last post by:
Hi, I use the llib library from adler and compiled it myself. First I build the lib configuration, then I included zlib.h in stdafx.h and I added a lib reference...
7
by: Victor | last post by:
Hi everybody ! Could anybody shed some light into the following paradox : I am creating a static library under VS 2005 VC++ Win32 using MFC. If compiled right after creating by a wizard, a...
3
by: Charles Nicholson | last post by:
Hello all- I have some static C++ libraries that I wrote in VS2003 but which upgraded fine when i went to VS2005 Pro. In them i overload the global versions of operators new, new, delete, and...
7
by: =?Utf-8?B?UmFtZW5kcmEgS290aGFya2Fy?= | last post by:
Hello, I want to know how to statically link GDIPlus.dll with VC++ application that should be able to run on W2k machine without the existence of GDIPlus.dll on the target machine. Currently,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.