• 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
[SOLVED] Re: Loading CFM from Mach-o...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SOLVED] Re: Loading CFM from Mach-o...


  • Subject: [SOLVED] Re: Loading CFM from Mach-o...
  • From: Dave Thorup <email@hidden>
  • Date: Wed, 21 Jan 2004 11:00:22 -0500

Thanks to a suggestion of one of my coworkers I was able to get this working. The problem was C++ name mangling. In the CodeWarrior simple shared library example (that exports a BeepTwice() function) the source file is a ".cp" file meaning it was being compiled as C++. If I put an 'extern "C"' around the function declaration then the symbol is exported properly without mangling:

#pragma export on
extern "C" {
int BeepTwice( void );
}
#pragma export off

Of course I could probably just change the source file to ".c" and that would work too.

Now I can successfully load the Bundle with a CFM shared library (shlb), find the "BeepTwice" symbol, and run the code in both of my simple Carbon and Cocoa Mach-o applications!.

Bundles rock!

Dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: PackageMaker from the command line
  • Next by Date: RE: Showing a URL with spaces in a NSAlertPanel
  • Previous by thread: Re: PackageMaker from the command line
  • Next by thread: Tool for seeing view hierarchies at runtime?
  • Index(es):
    • Date
    • Thread