Re: C++ gets translated into ObjC? Strange compiler errors... [RESOLVED]
Re: C++ gets translated into ObjC? Strange compiler errors... [RESOLVED]
- Subject: Re: C++ gets translated into ObjC? Strange compiler errors... [RESOLVED]
- From: "Brian Barth" <email@hidden>
- Date: Mon, 15 May 2006 14:36:39 +0200
Hi all
After some fiddling I just found a way so that my original problem got
solved (see below).
The compiler errors vanished once I included the problematic files in
the definition file *before* importing the header.
In my case this was:
#include <iostream>
#import "TestXYZ.h"
...
Now everythings works fine.
Just for the record.
Thanks for all that helped!
Great list!
Brian.
I wrote:
> 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, ...
--
Customer: I'm running Windows '98
Tech: Yes.
Customer: My computer isn't working now.
Tech: Yes, you said that.
· · · 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