• 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: xcode & c++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xcode & c++


  • Subject: Re: xcode & c++
  • From: Fritz Anderson <email@hidden>
  • Date: Fri, 02 Mar 2012 13:30:43 -0600

On 2 Mar 2012, at 11:20 AM, Livio Isaia wrote:

I'm trying to create some c++ classes in an objective-c program, but always receive error
<error: expected '=', ',', ';', 'asm' or '__attribute__' before 'X3DBaseDataObject'>
when compiling.
the header file (where the error appears) starts simply with this:

typedef struct{
    float x, y, z;
}Vertex3;

typedef struct{
    float x, y, z, w;
}Vertex4;

class X3DBaseDataObject {
public:
virtual void destroy();
};
... ... ...

Where am I wrong?
I tried setting the. cpp file to .mm and of type .cpp .objcpp, but still doesn't work.
Also

 #ifdef __cplusplus
extern "C" {
#endif

doesn't help.

The likeliest explanation is that the header is being #imported/#included by an Objective-C or C file you don't expect. Find the error in the Issues navigator. There will be a disclosure triangle next to it. One of the rows inside the issue will start with "In file included from." Hover the mouse pointer over that line for about ever, and eventually you will get a tooltip with the full content of that line. It will identify the source file that imported the header.

(You can also go to the Log navigator (last tab) and get a more-conventional build log, in which you still have to click a disclosure triangle, but the path to the file in question is spelled out clearly.)

— F

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

This email sent to email@hidden

References: 
 >xcode & c++ (From: Livio Isaia <email@hidden>)

  • Prev by Date: Re: xcode & c++
  • Next by Date: Re: Xcode - An Apple Embarrassment
  • Previous by thread: Re: xcode & c++
  • Next by thread: Re: 4.3 question and old Developer folder
  • Index(es):
    • Date
    • Thread