I'd like gcc to include files from $HOME/include
in addition to the usual include directories, but there doesn't seem to be an analogue to $LD_LIBRARY_PATH. I know I can just add the include directory at command line when compiling (or in the makefile), but I'd really like a universal approach here, as in the library case.
views:
13494answers:
4
+19
A:
Try setting C_INCLUDE_PATH
(for C header files) or CPLUS_INCLUDE_PATH
(for C++ header files).
More details here.
jcrossley3
2009-02-17 21:31:18
+1
A:
Create an alias for gcc with your favorite includes.
alias mygcc='gcc -I /whatever/'
dirkgently
2009-02-17 21:31:54
+2
A:
Here is link to GCC 4.4.3 manual where C_INCLUDE_PATH and CPLUS_INCLUDE_PATH environment variables are documented.
mloskot
2010-01-23 16:59:53