maxgust@maxgust-VirtualBox ~ $ arm-linux-gnueabihf-gcc hello.c -o hello
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
maxgust@maxgust-VirtualBox ~ $ find /usr/ -name crt*
/usr/src/ndiswrapper-1.60/crt.c
/usr/lib32/crtn.o
/usr/lib32/crti.o
/usr/lib32/crt1.o
/usr/lib/x86_64-linux-gnu/crtn.o
/usr/lib/x86_64-linux-gnu/crti.o
/usr/lib/x86_64-linux-gnu/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtprec64.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtfastmath.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtprec80.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtprec32.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtbeginT.o
/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/crtbeginS.o
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/crtfastmath.o
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/crtendS.o
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/crtbegin.o
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/crtbeginT.o
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/crtend.o
maxgust@maxgust-VirtualBox ~ $ echo $LIBRARY_PATH
/usr/lib/x86_64-linux-gnu
maxgust@maxgust-VirtualBox ~ $ cat hello.c
#include <stdio.h>
int main()
{
printf("111");
return 0;
}
maxgust@maxgust-VirtualBox ~ $
离线
解决了我的虚拟机是MINT如果通过sudo apt-get install gcc-arm-linux-gnueabihf来安装,,会报ctr1.o和ctrl.o错误。不知道为啥子
参考了: http://zero.lichee.pro/%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91/kernel_build.html#linux
解决了
离线