This is the mail archive of the
mailing list for the GCC project.
Re: relative include search path
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Denis Onischenko <denis dot onischenko at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 25 May 2009 13:15:19 +0100
- Subject: Re: relative include search path
- References: <firstname.lastname@example.org>
Denis Onischenko wrote:
> I have a problem with gcc not finding location for stddef.h include
> file when it is invoked from directory other than
Questions about the usage of GCC should go to the gcc-help mailing list,
rather than this one which is about the development of the internals of GCC.
What you have discovered here may appear to be a bug, but in fact it is by
design, so please send any follow-ups to the gcc-help list, thank you.
> Output from gcc invocation with -v option contains the following:
> ignoring nonexistent directory "../lib/gcc..."
> i.e. gcc is trying to find include files in directory with relative path.
> So it is works only when working directory is /usr/bin, where gcc is installed.
> Why gcc looks for headers in directories with relative paths ?
So that you can move the entire installation somewhere else and it will all
work because it will all be in the same relative locations compared to the new
$prefix as it was when installed in the original $prefix.
What you have done is move a single part of the installation to a new
location and leave the rest behind. That is not supported, and there's no
simple and direct way in which it could be.