Re: search paths
Re: search paths
- Subject: Re: search paths
- From: Andreas Grosam <email@hidden>
- Date: Fri, 1 Apr 2005 13:10:43 +0200
On 31.03.2005, at 21:36, Steve Mills wrote:
On Mar 30, 2005, at 12:27, Andreas Grosam wrote:
[snip]
I just installed 8a425 and <string> still can't be found. This really sucks. <string> is included from one of my .h files. That .h file is included from my .pch. It's trying to procompile the .pch when it gets this error. How do I fix this? It should be a no-brainer. Obviously, something is hosed or this wouldn't be an issue.
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
<x-tad-smaller>gcc-3.3. </x-tad-smaller>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
Well now check this:
1) Ensure the search paths are correct, respectively check if standard headers are indeed there.
The paths may vary if you used a different compiler version.
Normaly, the search paths are hard wired into the compiler and the standard headers have been installed during a correct install procedure. This ensures, that for each compiler version the (corresponding) standard headers will be located always in their supposed locations.
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.
To figure out what happens with option "-nostdinc++" try this:
gcc -x c++ -nostdinc++ -v -M foo.h
Well, normally, you should NOT find an error there, but we need to ensure this beforehand.
Andreas
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
_______________________________________________
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