• 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: Steve Mills <email@hidden>
  • Date: Fri, 1 Apr 2005 16:13:40 -0600

On Apr 1, 2005, at 14:21, Andreas Grosam <email@hidden> wrote:

When you get compile errors you should check this:
In order to check where the compiler you are using searches for
standard headers, open Terminal and type the follwing into the console:

touch foo.h
gcc -x c++ -v -M foo.h

Ensure "gcc" is acutally the compiler you are using! My XCode uses
gcc-3.3. Take a look into the detailed build result in XCode and figure
out which compiler is actually called.

The first command creates an empty file named "foo.h".

The second command calls gcc and causes it to print out some usefull
information (option -v).
We are intereseted in the search paths.
In the Terminal window you should read something like this:
#include <...> search starts here:
  /usr/include/gcc/darwin/3.3/c++
  /usr/include/gcc/darwin/3.3/c++/ppc-darwin
  /usr/include/gcc/darwin/3.3/c++/backward
  /usr/include/gcc/darwin/3.3
  /usr/include

Mine is using 4.0, and string is indeed within in /usr/include/gcc/darwin/4.0/c++/.


2) Also check if you did not inadvertently compiled your sources with
an option "-nostdinc++". If this is the case, the compiler will not use
the implicit search paths for C++ standard headers. Again take a look
into the detailed build result and check the options passed to the
compiler.

That option is not on.

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>.

Now another problem popped up. In another .h file, it can not find <CarbonCore/TextEncodingConverter.h>. The CoreServices.framework is in my project, and that framework has CarbonCore.framework, and that framework does have TextEncodingConverter.h in it. So why can't it find it? Since I'm fairly new to Mach-O, I tried a couple other variances, like <CoreServices/TextEncodingConverter.h> and <CoreServices/CarbonCore/TextEncodingConverter.h>. Commenting out the #include in my file allows the file to compile, so whatever.

Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/

_______________________________________________
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


  • Follow-Ups:
    • Re: search paths
      • From: Andreas Grosam <email@hidden>
    • Re: search paths
      • From: Chris Espinosa <email@hidden>
  • Prev by Date: RE: Function's default values are corrupted (Nasty bug)
  • Next by Date: Re: XCode and gcc - adding include directories
  • Previous by thread: Re: search paths
  • Next by thread: Re: search paths
  • Index(es):
    • Date
    • Thread