0

现在我正在使用 gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf 并使用 eclipse 进行交叉编译。但是在构建时,我会收到类似的错误

home/osboxes/artik5/opt/toolchains/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
/home/osboxes/artik5/opt/toolchains/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
/home/osboxes/artik5/opt/toolchains/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/arm-linux-gnueabihf/libpthread.so.0
makefile:209: recipe for target 'hc' failed
/home/osboxes/artik5/opt/toolchains/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a

任何人都可以帮我修复这个错误。/home/osboxes/artik5/opt/toolchains/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/li我在b中找到 crt1.o、crti.o、libpthread.so.0 和 libpthread_nonshared.a

4

1 回答 1

0

rt1.o、crti.o 和 crtn.o 以及 libc.a 都与您的 glibc 一起提供。您需要使用 --sysroot选项来告诉 gcc 在哪里搜索由 glibc 创建的二进制文件。

于 2018-04-02T08:32:56.123 回答