C++ gets translated into ObjC? Strange compiler errors...
C++ gets translated into ObjC? Strange compiler errors...
- Subject: C++ gets translated into ObjC? Strange compiler errors...
- From: "Brian Barth" <email@hidden>
- Date: Wed, 10 May 2006 19:12:59 +0200
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:
This email sent to email@hidden