• 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: Linking C++ and Objective-C files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking C++ and Objective-C files


  • Subject: Re: Linking C++ and Objective-C files
  • From: Jens Ayton <email@hidden>
  • Date: Fri, 24 Jul 2009 10:19:49 +0200


On Jul 24, 2009, at 09:58, Andreas Menzi wrote:

Hi all,

I have a problem linking an m-file in my project which is a C++ bundle. I tried to include the m-file from the following code sample in my project:


As with C, Objective-C functions used from C++ must be declared extern "C". In the appropriate header, you need something like this:

#if __cplusplus
extern "C" {
#endif

whateverTheReturnTypeIs CreateCocoaCursor(CGImage*, float, float);

#if __cplusplus
}
#endif


-- Jens Ayton

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


References: 
 >Linking C++ and Objective-C files (From: Andreas Menzi <email@hidden>)

  • Prev by Date: Re: Linking C++ and Objective-C files
  • Next by Date: Running Xcode via X11 from a remote machine?
  • Previous by thread: Re: Linking C++ and Objective-C files
  • Next by thread: Re: Linking C++ and Objective-C files
  • Index(es):
    • Date
    • Thread