-sysroot 的作用

如果在编译时指定了-sysroot就是为编译时指定了逻辑目录。编译过程中需要引用的库,头文件,如果要到/usr/include目录下去找的情况下,则会在前面加上逻辑目录。

如此处我们指定 -sysroot=/home/shell.albert/tools/toolschain_arm/4.4.3/arm-none-linux-gnueabi/sys-root

则如果在编译过程中需要找stdio.h,则会用/usr/include/目录下去找,因为我们指定了系统目录,则会到下面的路径去找。

转载于:https://www.cnblogs.com/bigworld/p/9413649.html

Logo

更多推荐