• 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: c++ in obj-c cocoa apps (post-FAQ)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c++ in obj-c cocoa apps (post-FAQ)


  • Subject: Re: c++ in obj-c cocoa apps (post-FAQ)
  • From: "R. Scott Thompson" <email@hidden>
  • Date: Thu, 28 Oct 2004 11:50:22 -0500


On Oct 28, 2004, at 11:22 AM, Sean Gilbertson wrote:


I've read the section in the FAQ <http://www.alastairs-place.net/cocoa/faq.txt> on including C++ code in objective-C Cocoa apps, and I've also read what I can find on the net, but I still have some questions:

- Is it feasible to include standard, no-complaints-from-gcc-on-the-commandline C++ code in Cocoa-oriented objective-c source files? I get plenty of errors about everthing from syntax to not finding standard C++ includes (e.g. exception; string), which seem to indicate that the compiler is assuming the code is written in C rather than C++.

I include C++ code (including exception and string) in my Objective-C++ code "all the time". Are you using the ".mm" or ".M" extension on your files?

- Can I compile a library of C++ classes separately, and use them in Cocoa-oriented objective-c code?

Yes. I do that as well.

- If I can't include the code as-is, is there some preferably trivial way I can alter it so that the compiler will like it?

Are your file name extensions correct?

Scott

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

This email sent to email@hidden
References: 
 >c++ in obj-c cocoa apps (post-FAQ) (From: Sean Gilbertson <email@hidden>)

  • Prev by Date: c++ in obj-c cocoa apps (post-FAQ)
  • Next by Date: Re: setShouldCascadeWindows: Not Working
  • Previous by thread: c++ in obj-c cocoa apps (post-FAQ)
  • Next by thread: Two synchronized NSMovieViews
  • Index(es):
    • Date
    • Thread