• 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: Albion Baucom <email@hidden>
  • Date: Thu, 1 Jul 2004 12:14:18 -0700 (PDT)

On Thu, 1 Jul 2004, myah wrote:

> 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 Thu, 1 Jul 2004, Allan Odgaard wrote:

> Use .mm instead:
> http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/
> 3objc_language_overview/chapter_3_section_10.html

Allan, Myah,

Thanks for the replies. I tried this, but nothing changes. Here is the
header. Ill be darned if I can figure out what it is complaining about.
This code happily compiles to object code at the command line with g++. No
parse errors, no warnings.

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

class WebMOReader
{
public:
WebMOReader();
~WebMOReader();

MolecularIsosurface* SetFileName(char* filename);

enum {
INVALID,
MO,
DENSITY,
ESP,
ELECTROPHILIC,
NUCLEOPHILIC,
RADICAL
} FileType;

private:
MolecularIsosurface* isosurface;

int ReadHeader(ifstream &input);
int ReadAtoms(ifstream& input);
int ReadBonds(ifstream& input);
int ReadAOOrder(ifstream& input);
int ReadGTO(ifstream& input);
int ReadSTO(ifstream& input);

int ReadMO(ifstream& input);
int ReadDensity(ifstream& input, int occupiedOnly);

enum dOrbital {dx2,dy2,dz2,dxy,dxz,dyz};
dOrbital dOrbitalOrder[6];
enum fOrbital
{fx3,fy3,fz3,fxxy,fxxz,fyyx,fyyz,fzzx,fzzy,fxyz};
fOrbital fOrbitalOrder[10];
};
-------------------------------------------------------------------------

Here are just a "few" of the many errors that it generates for this file
alone:

error: parse error before "WebMOReader" WebMOReader.h:4
error: syntax error before '{' token WebMOReader.h:5
error: parse error before ':' token WebMOReader.h:10
error: parse error before '&' token WebMOReader.h:10

The source file is now named "WebMOReader.mm". Xcode is just not invoking
the C++ compiler it seems.

How about the groups in my project? Could this foul up the compilation? Is
there anything special about group names in the project that would make
Xcode behave like this?

This is frustrating.

Thanks for any more help.

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.


  • Follow-Ups:
    • Re: Mixing Objective-C and C++ in Xcode
      • From: Steve Checkoway <email@hidden>
  • Prev by Date: Re: Forwarding to Super
  • Next by Date: Re: [iText-questions] absolute positioning in or inch
  • 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