AnsweredAssumed Answered

Cross compile helloworld error.

Question asked by Bob King on Apr 4, 2016
Latest reply on Apr 4, 2016 by jimmychan

Hi,   

     I am trying to compile helloworld for imx6ulevk,but it give  link errors:

/home/whz/key/whz_imx6ul_gui/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc -Wall  --sysroot=/home/whz/key/whz_imx6ul_gui/tmp/sysroots/x86_64-linux/ -o hello hello.c -L/home/whz/key/whz_imx6ul_gui/tmp/sysroots/x86_64-linux/usr/lib -L/home/whz/key/whz_imx6ul_gui/tmp/sysroots/imx6ulevk/usr/lib/arm-poky-linux-gnueabi/4.9.2 -L/home/whz/key/whz_imx6ul_gui/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/glibc/2.21-r0/sysroot-destdir/usr/lib -L/home/whz/key/whz_imx6ul_gui/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/libgcc/4.9.2-r0/gcc-4.9.2/build.arm-poky-linux-gnueabi.arm-poky-linux-gnueabi/libgcc/ -L/home/whz/key/whz_imx6ul_gui/tmp/sysroots/imx6ulevk-tcbootstrap/usr/lib

/home/whz/key/whz_imx6ul_gui/tmp/sysroots/x86_64-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crt1.o: No such file or directory

/home/whz/key/whz_imx6ul_gui/tmp/sysroots/x86_64-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crti.o: No such file or directory

/home/whz/key/whz_imx6ul_gui/tmp/sysroots/x86_64-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtbegin.o: No such file or directory

collect2: error: ld returned 1 exit status

 

Note:

     At the begining,te error is "Cannot find stdio.h",I copy those include file to cross compile's includelib.Then error become many  link error,so I use the -L option to tell compile where is those lib.But,even I add another "-L" where have file "crt1.o",it also have this error.What can I do?

Thank you!

Outcomes