Re: cpp class keyword
Re: cpp class keyword
- Subject: Re: cpp class keyword
- From: Andreas Grosam <email@hidden>
- Date: Fri, 29 Apr 2011 09:35:07 +0200
On Apr 29, 2011, at 5:49 AM, koko wrote:
> Well, apparently, compiling for iOS app versus iOS static lib treats the processing of the .pch diifferently.
> Moving some things out of .pch in the app build which are in the .pch of the lib build solved my problem.
> I would like to know more about this if anyone can shed some light.
When you have a project with C and C++ modules (respectively Objective-C and Objective-C++) , you get two versions of precompiled headers:
One compiled with C, and another with C++. Both version get compiled from the same precompiled-header file. And yes, these are different.
For each translation unit (either C or C++, respectively Objective-C or Objective-C++) the corresponding precompiled header version will be included by Xcode. You may verify this in the build transcript.
Occasionally, there may occur conflicts in a C and a C++ version of the included headers that affect two or more translation units in an undesired way (for instance, differently defined symbols, where they shall not). If you allow the headers to be included in both languages, this can be seen as a bug in the headers:
If you include the same headers in either C or C++ (respectively Objective-C and Objective-C++) you need to write your headers in a portable way, regarding the two different languages.
Though, most probably you do not wont to include a header intended to be used for C++ in an Objective-C or C module. Most likely, you want it compile as an Objective-C++ or C++ module. So, if you do it anyway this is a programmer error.
_______________________________________________
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