• 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: Cocoa with carbon calls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa with carbon calls


  • Subject: Re: Cocoa with carbon calls
  • From: Eric Schlegel <email@hidden>
  • Date: Wed, 21 Dec 2005 09:32:53 -0800


On Dec 21, 2005, at 9:22 AM, Livio wrote:

I'm working at a cocoa application (Mac OS X.3.6) and need to make carbon calls.
In my project (XCode 1.0) I've created 2 carbon files (extensions ".h" and ".cpp") with all the carbon procedures.
When I build the application everything seems to work, but at runtime a "ZeroLink: unknown symbol ..." is returned.
Can anybody tell me what happens and what I should do?

You probably need to surround the function prototypes in your .h file with


#ifdef __cplusplus
extern "C" {
#endif

and
#ifdef __cplusplus
}
#endif

so that the C++ compiler won't name-mangle the functions in the .cpp file.

Also, note that you don't have to put calls to Carbon APIs into a separate source file; you can make those calls from your Objective-C source file too. You can even use C++ in your Objective-C source file if you end the file with .mm instead of .m.

-eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Cocoa with carbon calls (From: Livio <email@hidden>)

  • Prev by Date: Cocoa with carbon calls
  • Next by Date: Re: Cocoa with carbon calls
  • Previous by thread: Cocoa with carbon calls
  • Next by thread: Re: Cocoa with carbon calls
  • Index(es):
    • Date
    • Thread