gcc - gcc 的 --sysroot 开关的替代品?

标签 gcc path header

当您不希望标准路径中的 header /库影响您的构建时,--sysroot 开关非常有用。

--sysroot=dir: Use dir as the logical root directory for headers and libraries. For example, if the compiler would normally search for headers in /usr/include and libraries in /usr/lib, it will instead search dir/usr/include and dir/usr/lib. [ref]

可以通过使用环境变量、gcc specs 文件或任何其他不需要命令行开关的方法来完成同样的事情吗?

最佳答案

如果可以使用环境变量,则可以将 --sysroot 添加到 CFLAGS。

关于gcc - gcc 的 --sysroot 开关的替代品?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15209062/

相关文章:

linux 和 gcc 4 中的 C++ 新运算符线程安全

c - 有没有办法省略 C 预处理器输出顶部的定义(行标记)?

algorithm - 将无向图分解为最小路径和循环

android - recyclerview android中的多个 header

c++ - 在同一代码文件中包含 Directx 9 和 10

c - 如何使用多个源文件和头文件

c++ - 为什么模板化的派生类可以在 gcc 上访问其基私有(private)成员?

Linux/海湾合作委员会 : ldd functionality from inside a C/C++ program

Mac 上的 Python,设置已安装模块的路径,以便 Python 可以使用

c - 从相对路径获取绝对路径