Calling _init for libraries

Joerg Sonnenberger joerg at britannica.bec.de
Mon Mar 28 09:31:00 PST 2005


On Mon, Mar 28, 2005 at 06:16:53PM +0100, Jonathon McKitrick wrote:
> 
> I'm having trouble getting my libraries to use _init() when they are loaded
> with dlopen().  What is the trick to this?  So far, I either get a linker
> error that the label is already defined, or else the routine never ends up
> being called at all.

I'm not sure if we support _init() or even want to support that.
The correct solution (but maybe not the most portable) is
__attribute__((constructor)).

Joerg





More information about the Users mailing list