Skip navigation.
 
mlRe: Objective-C++
FROM : John Stiles
DATE : Fri Feb 08 23:56:34 2008

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_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlObjective-C++ Philip Bridson Feb 8, 23:51
mlRe: Objective-C++ John Stiles Feb 8, 23:56
mlRe: Objective-C++ Dave Carrigan Feb 8, 23:58
mlRe: Objective-C++ Philip Bridson Feb 9, 00:03
mlRe: Objective-C++ John Stiles Feb 9, 00:06
mlRe: Objective-C++ Wesley Smith Feb 9, 00:11
mlRe: Objective-C++ Philip Bridson Feb 9, 00:14
mlRe: Objective-C++ Herb Petschauer Feb 9, 00:24
mlRe: Objective-C++ Philip Bridson Feb 9, 00:25
mlRe: Objective-C++ Charles Steinman Feb 9, 00:28
mlRe: Objective-C++ Herb Petschauer Feb 9, 00:31
mlRe: Objective-C++ Herb Petschauer Feb 9, 00:44
mlRe: Objective-C++ Philip Bridson Feb 9, 00:49
mlRe: Objective-C++ Herb Petschauer Feb 9, 00:55
mlRe: Objective-C++ Philip Bridson Feb 9, 01:02
mlRe: Objective-C++ Herb Petschauer Feb 9, 01:04
mlRe: Objective-C++ Philip Bridson Feb 9, 01:09
mlRe: Objective-C++ Jens Miltner Feb 11, 17:52
mlRe: Objective-C++ Scott Andrew Feb 11, 18:06
mlRe: Objective-C++ Sean McBride Feb 11, 19:34
mlRe: Objective-C++ Simone Tellini Feb 11, 19:42
mlRe: Objective-C++ Scott Andrew Feb 11, 19:52
mlRe: Objective-C++ Jens Miltner Feb 12, 08:35
mlRe: Objective-C++ Uli Kusterer Feb 12, 13:24
mlRe: Objective-C++ Thomas Engelmeier Feb 13, 11:09
mlRe: Objective-C++ Uli Kusterer Feb 13, 11:25