arm cross compilation unrecognized --sysroot option。(Eclipse)

时间:2014-08-04 06:25:04

标签: eclipse eclipse-plugin arm cross-compiling ld

我正在尝试使用sysroot进行autotools项目的交叉编译。我用于autogen脚本的选项如下。

CC=arm-linux-gnueabihf-gcc --with-sysroot=/opt/sysroot/dir \
   --host=arm-linux-gnueabihf --sysroot=/opt/sysroot/dir --prefix=/some/dir

但是在eclipse插件中,它显示--sysroot选项无法识别,但同样的命令在终端中正常工作。

ERROR:
configure: error: unrecognized option: --sysroot=/opt/sysroot/dir
configure: error: unrecognized option: --sysroot=/opt/sysroot/dir
Try ./configure --help' for more information

如果我在eclipse中删除--sysroot选项,那么autogen工作正常,但我收到以下链接器错误。

/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/../lib/libwebkit_clutter-0.so when searching for -lwebkit_clutter-0
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //usr/lib/libwebkit_clutter-0.so when searching for -lwebkit_clutter-0
make[2]: Leaving directory `/home/dir/workspace/Sharukh/sources/applications'
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lwebkit_clutter-0
make[1]: Leaving directory `/home/dir/workspace/Sharukh/sources'
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/../lib/libwebkit_clutter_mx.so when searching for -lwebkit_clutter_mx
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //usr/lib/libwebkit_clutter_mx.so when searching for -lwebkit_clutter_mx
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lwebkit_clutter_mx
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /lib/../lib/libcgroup.so when searching for -lcgroup
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //lib/libcgroup.so when searching for -lcgroup
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lcgroup
collect2: error: ld returned 1 exit status
make[2]: *** [bin_Sharukh] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

我错过了什么?

1 个答案:

答案 0 :(得分:3)

您真的不需要使用--with-sysroot因为--sysroot已经足够了。

您的配置应该是这样的

CC="arm-linux-gnueabihf-gcc" \
CFLAGS="--sysroot=/opt/sysroot/dir" ./configure \
            --prefix=/some/dir \
            --host=arm-linux-gnueabihf