Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED] C++ in a Cocoa App - How Hard is THAT?



Hello all

I mix C++ and Objective-C in my project. If any objective-C file needs to deal with C++ I give it a .mm extension and it works fine. So if you don't change the 'Compile Source As' setting, you need to name any objective-C file that includes a C++ header with a .mm extension.

Matt Owings

Message: 6
Date: Sat, 8 Oct 2005 11:20:14 -0600
From: Lance Drake <email@hidden>
Subject: [SOLVED]  C++ in a Cocoa App - How Hard is THAT?
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed

Hi XCode folks,

Many thanks to the very nice folks who chimed in on this issue. For
the record, here's what ended getting me the traction to move on past
that problem.


    Compiling the C++ file occurs entirely without incident - it was
including the C++ header file with 'class myObject {... }' in the
Objective-C header that caused all the commotion.

    In the project 'style' settings I set "Compile Sources As" to be
'Objective-C++'.  That was it.  I KNEW it had to be something simple -
hence the query, "How hard is THAT?".

It was interesting to chase all over the net and through all the books
I have and find so little that specifically dealt with this issue. The
fact that a number of folks immediately responded was a heart-warming
feeling to know that there IS a Mac developer community out there and
it's so full of kind, intelligent souls.


Best Regards,

Lance Drake
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.