From: Louis Lavery on
Hello,

Is there a simple way to check that a C++ lib is complete,
that is that it does not have any external dependencies?

Thanks, Louis.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: paperab on
On Nov 2, 4:53 pm, Louis Lavery <Lo...(a)LaverREMOVE.demon.co.uk> wrote:
> Hello,
>
> Is there a simple way to check that a C++ lib is complete,
> that is that it does not have any external dependencies?

{ edits: quoted sig and banner removed. please don't quote extraneous material
such as signatures or the banner (which is added to every article). -mod }

Hi,

A lib is something (I guess you mean a static library: the 'lib' is
vague) created by the linker... it's no more C++, may use some other
libraries or not (and again this definition is not precise at 100%
because can be linked statically with some of them).

Replying to your post in Windows you can use dumpbin /dependencies if
I remember well. In Linux there is another command: check the manual.

But... if the lib is only a wrapper to a dynamic loaded library you
are again in trouble.


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Jorgen Grahn on
On Tue, 2009-11-03, paperab wrote:
> On Nov 2, 4:53 pm, Louis Lavery <Lo...(a)LaverREMOVE.demon.co.uk> wrote:
>> Hello,
>>
>> Is there a simple way to check that a C++ lib is complete,
>> that is that it does not have any external dependencies?
....

> A lib is something (I guess you mean a static library: the 'lib' is
> vague) created by the linker... it's no more C++, may use some other
> libraries or not (and again this definition is not precise at 100%
> because can be linked statically with some of them).
>
> Replying to your post in Windows you can use dumpbin /dependencies if
> I remember well. In Linux there is another command: check the manual.

You probably mean something like this (which by the way is likely to
work in various Unixes):

% nm -C libprefer.a | grep -iw U

Note that it's not enough; if the library contains foo.o and bar.o you
get to see foo.o's unresolved references to symbols in bar.o, and so
on. A static library (in the usual sense) doesn't have its internal
dependencies resolved.

By the way, I suspect this is one of those cases where the original
poster could get a better answer if he explained what he wanted to
accomplish.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: AnonMail2005 on
On Nov 2, 11:53 am, Louis Lavery <Lo...(a)LaverREMOVE.demon.co.uk>
wrote:
> Hello,
>
> Is there a simple way to check that a C++ lib is complete,
> that is that it does not have any external dependencies?
>
google dependency walker. It's a free download. That will go a long
way toward telling you. But even that will sometimes give an external
dependency that is not needed.

HTH


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]