linux - 在 gcc 搜索路径的末尾添加路径

标签 linux gcc

我可以看到可以使用 -I 标志将路径添加到 gcc 搜索路径。但是,当使用 -v 时,我可以看到首先搜索路径。

无论如何我可以在最后搜索到我添加的搜索路径吗?

最佳答案

-idirafter 选项允许您指定一个包含目录,仅在所有常规 -I 目录和标准系统目录之后考虑。这记录在这里:

https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#Invocation

-idirafter dir

Search dir for header files, but do it after all directories specified with -I and the standard system directories have been exhausted. dir is treated as a system include directory. If dir begins with =, then the = will be replaced by the sysroot prefix; see --sysroot and -isysroot.

关于linux - 在 gcc 搜索路径的末尾添加路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25174930/

相关文章:

C - 在linux终端中打印希腊字母

linux - 如何让Linux每5分钟线程安全​​的执行一个php文件?

android - 获取错误 ld.exe : error: cannot find -lgnuSTL_shared in ndk on compiling tbb source files

c++ - 在进行基准测试时防止编译器优化

linux - 从文本文件转换数字

linux - 使用 setuid 的可执行文件找不到共享库

Linux线程资源泄漏?

oracle - 在 Oracle Solaris 11 上安装 GCC

gcc - 从 GCC 获取优化报告

c++ - gcc - 删除 "is used uninitialized in this function"警告