default search path for headers
Chris Croswhite
csc@cadence.com
Tue Jan 27 08:01:00 GMT 2004
I need to understand how to change the default include search path for
gcc when one uses the <> system context for header files. I need to
create a gcc install that I can use across multiple different distros of
linux and still use the same headers and libs. So I configured gcc
with:
--prefix=/opt/gcc323 --with-local-path=/opt/gcc323 --with-gnu-as
--disable-nls --disable-multilibs --with-sysroot=/opt/RH72
--host=i686-pc-linux-gnu
As a test I removed a header file from /usr/include and tried to compile
a simple app with the above configured compiler, which failed because
the header was missing out of /usr/include, even though the file existed
within the system root. So I had assumed using "--with-sysroot" and
supplying a set of libs and headers would work.
Even if within my make file I specify the correct path for includes, gcc
first searches the system includes (tested by placing a bogus header
file needed to compile).
So, is there a way to change the default behavior of gcc to search a
desired include and libs path or am I doing something completely wrong?
TIA,
Chris
More information about the Gcc-help
mailing list