A static lib using a static lib

A static lib using a static lib

Post by Maestro » Mon, 05 Mar 2007 02:31:56



VS 2005 C++ development

When developing a program which uses a static lib which I wrote, I can
specify the lib's location by opening the properties page and opening
the dialog box under link/input.

But when developing a static lib, lib1, which uses a static lib, lib2,
which I wrote, there is no link/input option. So how does the system
know where to find lib2 when I use lib1 in my program? There must be
a place where I specify the loc. of lib2, but I can't find it.
 
 
 

A static lib using a static lib

Post by Helge Krus » Wed, 07 Mar 2007 01:03:34

Hello Maestro,

you specify the names and the path to libs when you link the program. There
is no linking process when you generate the lib.

/Helge

 
 
 

A static lib using a static lib

Post by Maestro » Wed, 07 Mar 2007 02:57:20

On Mon, 5 Mar 2007 17:03:34 +0100, "Helge Kruse"


I can see that that would work.
It just doesn't seem right to me that if I am a developer given lib1
to use, that I need to track down all the static libs that it uses.
 
 
 

A static lib using a static lib

Post by Helge Krus » Wed, 07 Mar 2007 17:29:29

> It just doesn't seem right to me that if I am a developer given lib1

You can instruct the linker to link an additional library with the

#pragma comment(linker, "lib2")

somewhere in your code.

/Helge