gcc default include path
Andi Hellmund
mail@andihellmund.com
Tue Mar 30 16:44:00 GMT 2010
Hey,
> On linux:
>>From where does gcc picks up header files like stdio.h by default?
> Does it configure gcc to pick header files from particular location at the
> time of build?
There are default search directories statically configured at build time
(of gcc) and user-specified search directories specified at run-time.
To check the default search directories, you could run
# echo "" | gcc - -xc -v -E
[...]
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/i486-linux-gnu/4.4.1/include
/usr/lib/gcc/i486-linux-gnu/4.4.1/include-fixed
/usr/include
User-specified search directories are defined by the -I<dir> option
> On windows:
> I copied cygwin directory from one of my friend's machine where cygwin was
> installed to my machine.
> however when i run gcc from windows command prompt i get an error
> displaying
> "stdio.h : no such file or directory.
> header files are already present in cygwin\usr\include.
> I have placed cygwin on the same location where it was present in my
> friend
> machine C:\cygwin.
>
> In my PATH , i have set C:\cygwin\bin .
>
I would try the -v option and check where gcc searches for your header
files ...
- Andi -
More information about the Gcc-help
mailing list