Re: Loading the Foundation at runtime
Re: Loading the Foundation at runtime
- Subject: Re: Loading the Foundation at runtime
- From: Fritz Anderson <email@hidden>
- Date: Tue, 25 Jan 2011 07:55:45 -0600
On 24 Jan 2011, at 10:39 AM, Mathieu Suen wrote:
> int
> main ()
> {
> int error;
> objc_loadModule ("Foundation", onLoad, &error);
> return EXIT_SUCCESS;
> }
> ----------objc-test.c----------
>
> But the linker complain:
>
> Undefined symbols:
> "_objc_loadModule", referenced from:
> _main in ccX2yu3T.o
> ld: symbol(s) not found
>
> I have compile it using the command:
> gcc objc-test.c -g -lobjc -o test
According to nm, the symbol objc_loadModule does not appear in libobjc.dylib in at least my installation of 10.6.6. The delta notes for 10.5 in the runtime reference says the function is deprecated.
It doesn't show up in my copy of the 10.5 SDK, either, which I find strange. I'd think if it were merely deprecated, and certainly for backward compatibility, it should still be in the library.
The documentation says you should use NSBundle or dyld functions instead.
— F
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden