我可以看到可以使用 -I 标志将路径添加到 gcc 搜索路径。但是,当使用 -v 时,我可以看到首先搜索路径。
无论如何我可以在最后搜索到我添加的搜索路径吗?
最佳答案
-idirafter
选项允许您指定一个包含目录,仅在所有常规 -I
目录和标准系统目录之后考虑。这记录在这里:
https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#Invocation
-idirafter
dirSearch 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/