- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我找到了一个带有 Makefile 的源文件包,我浏览了一下,在 CFLAG 变量中,有一个 FLAG -I ,我在网上搜索过,但找不到它的实际作用。它与 C 文件中包含的库文件有关吗? (stdio.h,unistd.h,pthread.h)
请指出来源或简要解释一下,Flag -I 的作用是什么?
-问候
最佳答案
它就在 gcc
的手册页中(在 unix/linux 上用 man gcc
调用 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.
(确切的文本和语义可能因 gcc 版本而异)
或者还有 gcc 在线文档:http://gcc.gnu.org/onlinedocs/例如,版本 4.8.2 的选项可在此处找到:http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Directory-Options.html#Directory-Options
关于c - -I GCC ( Linux ) 中的标志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22143781/
我是一名优秀的程序员,十分优秀!