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

Re: search paths


  • Subject: Re: search paths
  • From: Andreas Grosam <email@hidden>
  • Date: Sat, 2 Apr 2005 12:25:26 +0200


On 02.04.2005, at 03:29, Chris Espinosa wrote:

On Apr 1, 2005, at 2:13 PM, Steve Mills wrote:


One thing I tried was setting the target's "Compile Source As" setting to C++ instead of "According to file suffix". That fixed the problem of it not finding <string>.

So let me get this straight, as there may be an interesting bug here:

- you have a .pch file that's your prefix
- you have Precompile Prefix Header checked
- your prefix file has an #include <string>

What target template did you use to create the target (or project and its default target)?  It could be that you started with a C project and you're trying to use C++ in a C project without telling the compiler that.

I would like to add this:
XCode uses a <x-tad-smaller>ProcessPCH </x-tad-smaller>build phase for C prefix headers and<x-tad-smaller> ProcessPCH++ </x-tad-smaller>for C++ prefix headers respectively.
So, Steve please check this, too.

Chris,
When precompiling, the option -x specifies whether to treat precompiled headers as C++ or C headers.
Which build setting controls whether to use C++ or C when pre-compiling them?

What do we have to set in the build settings panels if we have two targets, one a C++ product and another which is a C product and both have prefix headers which should be precompiled?

Does XCode identify prefix headers by suffix, and then useing an appropriate pre-compile rule? (It doesn't look so)
IMO, it would be more convenient, to just add prefix headers to the project and let XCode applying a rule according the suffix, instead to specify a prefix header and the flag "do pre-compile" somewhere in the settings.
This would require, that we have such a rule in the Rules panel available.


Does the compiler driver detect C++ prefix headers by suffix and thus would be able to deduce the language itself?
e.g. when the suffix is something like pch++?


gcc is generally stricter about applying standards-based interpretation to your files than CodeWarrior is.  CW lets you use C++isms in .c files pretty freely, where in gcc if you call a file ".c" it trusts you mean C, not C++.  

But it could well be that in absence of any guidance, gcc takes a .pch file and defaults it to C, which wouldn't necessarily be the best assumption.  I'll check on that.

Chris
_______________________________________________
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
 _______________________________________________
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: 
 >Re: search paths (From: Steve Mills <email@hidden>)
 >Re: search paths (From: Chris Espinosa <email@hidden>)

  • Prev by Date: How do I view contents of a simple C buffer in XCode debugger?
  • Next by Date: Re: search paths
  • Previous by thread: Re: search paths
  • Next by thread: Re: search paths
  • Index(es):
    • Date
    • Thread