GCC 编译 --sysroot

-sysroot 的作用

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

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

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

posted @ 2018-08-03 13:32  well_L  阅读(1410)  评论(0编辑  收藏  举报