Where does gcc look for C and C++ header files?

前端 未结 9 1787
悲&欢浪女
悲&欢浪女 2020-11-28 17:26

On a Unix system, where does gcc look for header files?

I spent a little time this morning looking for some system header files, so I thought this would be good info

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 18:04

    One could view the (additional) include path for a C program from bash by checking out the following:

    echo $C_INCLUDE_PATH
    

    If this is empty, it could be modified to add default include locations, by:

    export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/include
    

提交回复
热议问题