• 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++ gets translated into ObjC? Strange compiler errors...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ gets translated into ObjC? Strange compiler errors...


  • Subject: Re: C++ gets translated into ObjC? Strange compiler errors...
  • From: "Michael J. Bergin" <email@hidden>
  • Date: Wed, 10 May 2006 14:07:51 -0400

Did you set the "Compile Source As" build setting for the target from "According to File Type" to "Objective-C++"? I also came across the following link that had some interesting compatibility information about objc++ and universal binaries near the bottom of the page. Hope that helps.

http://developer.apple.com/documentation/DeveloperTools/Conceptual/ cross_development/UniversalBinaries/chapter_4_section_1.html


- Michael J. Bergin email@hidden Odology, inc. www.odology.com

  Launch any app, anywhere, in under a second
  Launcher by Odology
  www.odology.com/launcher


On May 10, 2006, at 1:12 PM, Brian Barth wrote:

Hi

Got a problem, that I can't make head nor tails of:
I got to targets, the MainApp and an UnitTest which is configured as an
dependant bundle (framework) just like Apple describes. Everything
worked fine. Then I added a new test which imports the class to be
tested which in return - in the import/include hierarchy - includes C++
iostreams.


When compiling the compiler (GCC 4.0) treats those c++ files in a weird
way: It seems that it is trying to translate C++ into Objective-C
/usr/include/c++/4.0.0/bits/basic_ios.h:108: error: expected unqualified-
id before '[' token
/usr/include/c++/4.0.0/bits/basic_ios.h:108: error: 'self' was not
declared in this scope
/usr/include/c++/4.0.0/bits/basic_ios.h:108: error: expected `]' before
'failWithException'
/usr/include/c++/4.0.0/bits/basic_ios.h:108: error: expected ';' before
'failWithException'
/usr/include/c++/4.0.0/bits/basic_ios.h:108: error: expected `;' before
']' token
at just one line:
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
Just as an example (35 errors so far).


MainApp has no problem at with those files.
Both targets are configured identically (even have different prefix-
Headers with identical content) - sources are compiled as ObjC++, no
optimiziation or anything special. Prefix contains
#ifdef __OBJC__
    #import <Cocoa/Cocoa.h>
#endif

Does anybody have any idea what went wrong?
I already tried different "compile source as" settings, different
#import-orders, ...
Any help greatly appreciated.

Thanxx

Brian.

--
It's not that I'm afraid to die. I just don't want to be there when it
happens.
-Woody Allen-
· · · b o b · · · (osXdriven) · · · www.bobthevisitor.de · · ·


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


This email sent to email@hidden

_______________________________________________ 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
  • Follow-Ups:
    • Re: C++ gets translated into ObjC? Strange compiler errors...
      • From: "Brian Barth" <email@hidden>
    • Re: C++ gets translated into ObjC? Strange compiler errors...
      • From: Scott Thompson <email@hidden>
References: 
 >C++ gets translated into ObjC? Strange compiler errors... (From: "Brian Barth" <email@hidden>)

  • Prev by Date: Re: Cocoa Bindings Question.
  • Next by Date: Re: iClass example, core data and multiple stores
  • Previous by thread: C++ gets translated into ObjC? Strange compiler errors...
  • Next by thread: Re: C++ gets translated into ObjC? Strange compiler errors...
  • Index(es):
    • Date
    • Thread