• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Loading the Foundation at runtime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading the Foundation at runtime


  • Subject: Re: Loading the Foundation at runtime
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 25 Jan 2011 09:24:16 +0100

Le 24 janv. 2011 à 17:39, Mathieu Suen a écrit :

> Hi All,
>
> In other to write a binding for a language I need to load the Foundation
> framework at run time.
> So just to test I wrote a simple example:
>
> ----------objc-test.c----------
> #include <objc/runtime.h>
> #include <stdio.h>
> #include <stdlib.h>
>
> void
> onLoad (Class this, char* inCat)
> {
>        printf ("Loading %s in %s\n", class_getName (this), inCat);
> }
>
>
>
> 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
>
> Thanks for help
>
> Mathiue
>

Obj-C runtime functions are in the libobjc that you should include to your project.



-- Jean-Daniel




_______________________________________________

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

References: 
 >Loading the Foundation at runtime (From: Mathieu Suen <email@hidden>)

  • Prev by Date: WebKit WebArchive Create but no Load?
  • Next by Date: Disable (grey out) main menu when displaying modal window?
  • Previous by thread: Loading the Foundation at runtime
  • Next by thread: Re: Loading the Foundation at runtime
  • Index(es):
    • Date
    • Thread