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

Re: Objective-C++


  • Subject: Re: Objective-C++
  • From: John Stiles <email@hidden>
  • Date: Fri, 08 Feb 2008 14:56:34 -0800

Philip Bridson wrote:
Hi there,

I am trying to write using Objective-C++. I have read the docs and understand what I can and can't do with it but I have a really basic problem. When I put #include <iostream> in my header files I get an error saying that the file cannot be found? Why is this?

Rename the file extension from .c or .m to .mm and try again.

Also when creating the file, do I create a C++ file or an Obj-C file or doesn't it matter?
Neither is right, you want a .mm file. You might need to rename it by hand if that isn't an option.

Finally, I want to do some thing like this

#ifdef _MAC_OS_X
    //do some obj-c code
#endif

#ifdef _WIN32
    //use WIN32 API coding
#endif

Does anyone know how to do this? Is the above correct?

Use #if __APPLE__


Many thanks for your help.

Phil.
_______________________________________________

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
_______________________________________________

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


  • Follow-Ups:
    • Re: Objective-C++
      • From: Philip Bridson <email@hidden>
References: 
 >Objective-C++ (From: Philip Bridson <email@hidden>)

  • Prev by Date: Objective-C++
  • Next by Date: Re: Objective-C++
  • Previous by thread: Objective-C++
  • Next by thread: Re: Objective-C++
  • Index(es):
    • Date
    • Thread