User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212
Hi,
I'm programming in C++ for Mac OS X 10.2.2. I'm using December 2002 Mac
OS X Developer Tools.
I would like the constructors of static instances of classes to be
called automatically when a dynamic shared library is *loaded* into a
program. Not when a symbol is used from the library. I can't get it to work.
Actually I've even tried with a simple C program and a function
specified with the -init option flag. This function is not called upon
loading the dynamic shared library - only when the first symbol is
used from the library.
The -bind_at_load option flag doesn't help either.
Here is the source code of the libfoo.dylib shared dynamic library:
Now if I uncomment the commented line so that a library symbol is used:
$ ./a.out
library_init()
use_library_symbol()
$
Is there any way to get intialization routines called when *loading* a
dynamic shared library? Am I maybe doing anything wrong when linking the
library or the program?
Regards,
--
Dimitri
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.