-I Flag in GCC ( Linux )

孤街醉人 提交于 2020-02-27 07:39:33

问题


I Have found a source file bundle with a Makefile, I went through it, and In CFLAG Variable, There is a FLAG -I , I have searched on the web, But couldn't find what it actually does. Is it something relevent to the library files included in the C file? ( stdio.h,unistd.h, pthread.h )

Please point me to a source or explain in brief, What does the Flag -I does?

-Regards


回答1:


It's right there in the man page of gcc (called with man gcc on unix/linux or you can find it via Google):

-I dir

Add the directory dir to the list of directories to be searched for header files. Directories named by -I are searched before the standard system include directories. If the directory dir is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated . If dir begins with "=", then the "=" will be replaced by the sysroot prefix; see --sysroot and -isysroot.

(The exact text and semantics may differ between versions of gcc)

Alternatively there is also the gcc documentation online: http://gcc.gnu.org/onlinedocs/ The option for version 4.8.2, as an example, can be found here: http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Directory-Options.html#Directory-Options



来源:https://stackoverflow.com/questions/22143781/i-flag-in-gcc-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!