linux - [Solved-4 Solutions] How to add a default include path for gcc in linux ? - ubuntu - red hat - debian - linux server - linux pc



Linux - Problem :

How to add a default include path for gcc in linux ?

Linux - Solution 1:

Try setting C_INCLUDE_PATH (for C header files) or CPLUS_INCLUDE_PATH (for C++ header files).

CPATH will set the path for both C and C++.

Linux - Solution 2:

alias mygcc='gcc -I /whatever/'
click below button to copy the code. By - Linux tutorial - team

Linux - Solution 3:

Here is link to GCC 4.8.1 manual where C_INCLUDE_PATH and CPLUS_INCLUDE_PATH environment variables are documented.

Linux - Solution 4:

A gcc spec file can do the job, however all users on the machine will be affected.


Related Searches to - linux - linux tutorial - How to add a default include path for gcc in linux?