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.
Try setting
C_INCLUDE_PATH(for C header files) orCPLUS_INCLUDE_PATH(for C++ header files) environment variables.As Ciro mentioned,
CPATHwill set the path for both C and C++ (and any other language).On Windows these may be set to semicolon-separated lists. On most other platforms they may be set to colon-separated lists.
More details in GCC’s documentation.