gnu.g++.help
[Top] [All Lists]

Re: Running initial code when in library

Subject: Re: Running initial code when in library
From: Paul Pluzhnikov
Date: Tue, 23 May 2006 14:31:15 -0700
Newsgroups: gnu.g++.help
"Paulo Matos" <pocmatos@xxxxxxxxx> writes:

> Any ideas on how can I know if the code is linked as shared or as
> static?

What's the link command line?

Add to it '-Wl,--verbose' and you'll see which libraries the linker
is actually using.

You can also easily verify my guess (that the objects you expect
aren't actually linked in):

- edit one of the sources that "fails to register", add:

  void function_that_is_never_called() { }

- rebuild
- run

   nm your_exe | grep function_that_is_never

If the output is nothing, my guess is corect.
If you get

  <some-hex-number> T function_that_is...

then my guess is wrong.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

<Prev in Thread] Current Thread [Next in Thread>