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

Re: Mixing Objective-C and C++ in Xcode


  • Subject: Re: Mixing Objective-C and C++ in Xcode
  • From: myah <email@hidden>
  • Date: Thu, 1 Jul 2004 12:00:50 -0500

On your implementation file webMOReader.m to webMOReader.mm mm is the suffix for objective-c++ code. If your header is included from that file then it should se it as a obj=c
++ header i think. I have several integrated c++ and obj-c files in my program. I hope that helps.


On Thursday, July 1, 2004, at 11:37 AM, Albion Baucom wrote:

I am new to Xcode and Mac development.

I have a program in Objective-C that compiled up to the point where I had
to integrate pre-written C++ code.

I am trying to compile a program that mixes C++ code and Objective-C. The
errors generated when I compile make it look as though Xcode does not
understand what a "class" is. Errors like this

error: parse error before "WebMOReader"

where WebMOReader is a class definition in a .h file like this

#include <fstream.h>
#include "MolecularIsosurface.h"

class WebMOReader
{
private:
...


and so forth. It doesn't matter whether I have the includes at the top of
the file or not. It just doesn't like "class Blah" for whatever reason.

I have included all the header files in a group that is a part of the
project, along with the corresponding source code (with a .cpp suffix).

Is there something special I have to do to make Xcode understand C++?

Is the suffix of the header file fooling it into thinking it is a Obj-C
header? What should I name it if so?

Thanks.

Albion

Albion E. Baucom
http://rna.ucsc.edu/albion
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Mixing Objective-C and C++ in Xcode (From: Albion Baucom <email@hidden>)

  • Prev by Date: Re: Mixing Objective-C and C++ in Xcode
  • Next by Date: Re: binding and too many relationship insertion
  • Previous by thread: Re: Mixing Objective-C and C++ in Xcode
  • Next by thread: Re: Mixing Objective-C and C++ in Xcode
  • Index(es):
    • Date
    • Thread