gpt4 book ai didi

c - -I GCC ( Linux ) 中的标志

转载 作者:太空狗 更新时间:2023-10-29 15:07:13 25 4
gpt4 key购买 nike

我找到了一个带有 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com