gs的--sysroot开关的替代品? [英] Alternatives to the --sysroot switch of gcc?
问题描述
当您不希望标准路径中的头文件/库影响您的构建时, - sysroot
开关很有用。
- sysroot = dir
:使用dir作为标题和
库的逻辑根目录。例如,如果
编译器通常在/ usr / include中搜索
头文件并在/ usr / lib中搜索库
,则它将搜索
dir / usr / include和DIR / usr / lib目录。 [ref]
同样的事情可以通过使用环境变量, gcc规范文件或任何其他方法来完成不需要命令行开关?
如果你可以使用环境变量,你可以添加--sroot到CFLAGS。 p>
The --sysroot
switch is useful when you don't want the headers/libraries in the standard paths affect your build.
--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]
Can the same thing be accomplished through the use of environment variables, the gcc specs file, or any other methods that do not require command line switches?
If you can use environment variables you can add --sysroot to CFLAGS.
这篇关于gs的--sysroot开关的替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!