• 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: Compile Erros
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compile Erros


  • Subject: Re: Compile Erros
  • From: Andreas Grosam <email@hidden>
  • Date: Fri, 29 Apr 2011 09:07:29 +0200


On Apr 29, 2011, at 3:57 AM, koko wrote:

I have built an iOS Cocoa Touch Static library.  The source is C++.  Builds with no error or warnings.

NOw I add this library to a View based iOS project.

I add a C++ file defining a test C++ class.

IN the .cpp I include a header for access to library finctions ... and here is what is wied to me ...

I get errors in the files that compiled as the library.

I get the following on inline, class and <template> statements

error: expected '=', ',', ';', 'asm' or '__attribute__' before '&' token

So is there a setting I am unaware of that lets me use this library in an iOS app?
-koko

From the error message alone it's hard to figure what's exactly wrong. It looks like, the C++ header will be compiled with an Objective-C or C compiler (rather than with an Objective-C++ or C++ compiler). Your description does NOT indicate this, though.

Does a simple C++ test app compiles without errors?

A further note:

Basically, when you include a C++ header (directly or indirectly) from within an Objective-C file, it will be "infected" with C++. Vice versa, any C++ header included from an Objective-C file shall be treated as C++. Thus you need to ensure your Objective-C files will be compiled with the Objective-C++ compiler, through using the file extension .mm.

 _______________________________________________
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: 
 >Compile Erros (From: koko <email@hidden>)

  • Prev by Date: Re: cpp class keyword
  • Next by Date: Re: 4.0.1 DSYMUTIL assertion
  • Previous by thread: Compile Erros
  • Next by thread: cpp class keyword
  • Index(es):
    • Date
    • Thread