Re: Cocoa with carbon calls
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