I've searched the newsgroup for threads related to CALL_ON_LOAD,
CALL_ON_MODULE_BIND, etc. but have not found an answer to my question.
If anyone can help it will be appreciated.
Using CW 9.1 on OS X 10.3, XCode 1.1, 10.3.0SDK
I'm trying to create a Mach-O framework that will call initialization
and termination routines when loaded and when terminated. Some people
have reported success using CALL_ON_UNLOAD but I cannot get my simple
toy Mach-O framework to execute its initialization and termination
routines using CALL_ON_LOAD/CALL_ON_MODULE_BIND and
CALL_ON_UNLOAD/CALL_ON_MODULE_TERM.
The framework source has:
#pragma CALL_ON_LOAD _init //(also tried CALL_ON_MODULE_BIND)
extern void _init()
{
// init code
}
The framework is linked with dylib1.o (Nov 2003).
I am able to get the _init() to run by putting it in the "Init Entry
Point" in the target settings, but would like to use the CALL_ON_*
since I have a termination routine to call as well.
Thanks for any help or advice on this.
Ki Suk Hahn
Ki Suk Hahn - 30 Sep 2004 14:43 GMT
Resolved in a re-posting I did on comp..sys.mac.programmer.codewarrior.
> I've searched the newsgroup for threads related to CALL_ON_LOAD,
> CALL_ON_MODULE_BIND, etc. but have not found an answer to my question.
[quoted text clipped - 28 lines]
>
> Ki Suk Hahn