Re: search paths
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