Cross compile for Qt5 build error #yocto
Hello,
After building a poky yocto image for the ARM emulator with Qt5, I am trying to build a simple hello world program with the generated toolchain.
However I am getting these errors on QtCreator (also tried with command line, same result)
arm-poky-linux-gnueabi-g++ -march=armv5e -marm --sysroot=/opt/poky/2.2.1/sysroots/armv5e-poky-linux-gnueabi -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o helloworld main.o -L/opt/poky/2.2.4/sysroots/armv5e-poky-linux-gnueabi/usr/lib -lQt5Core -lpthread /opt/poky/2.2.4/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.4.0/real-ld: cannot find crt1.o: No such file or directory /opt/poky/2.2.4/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.4.0/real-ld: cannot find crti.o: No such file or directory /opt/poky/2.2.4/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.4.0/real-ld: cannot find crtbegin.o: No such file or directory /opt/poky/2.2.4/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.4.0/real-ld: cannot find /lib/libpthread.so.0 /opt/poky/2.2.4/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/6.4.0/real-ld: cannot find /usr/lib/libpthread_nonshared.a
collect2: error: ld returned 1 exit status
I tried searching for those files, the one below for example is not in the same sysroot I configured:
/opt/poky/2.2.4/sysroots/armv5e-poky-linux-gnueabi/usr/lib/arm-poky-linux-gnueabi/6.4.0/crtbegin.o
I also tried copying manually those missing files to the right directory with the necessary permissions but it didn't change anything.
I also tried putting libgcc in the poky configuration file and rebuilding the toolchain, but didn't work either:
# add the Qt packages so that they get included in the built image and we don't have to install them separately IMAGE_INSTALL_append = " gcc g++ binutils libgcc libgcc-dev libstdc++ libstdc++-dev libstdc++-staticdev eglibc-staticdev autoconf automake ccache chkconfig glib-networking packagegroup-core-buildessential pkgconfig boost cmake zlib glib-2.0 qt3d qt5-plugin-generic-vboxtouch qtbase qtcanvas3d qtcharts qtconnectivity qtdatavis3d qtdeclarative qtenginio qtgraphicaleffects qtimageformats qtlocation qtmultimedia qtquick1 qtquickcontrols2 qtquickcontrols qtscript qtsensors qtserialport qtsvg qtsystems qttools qttranslations qtvirtualkeyboard qtwebchannel qtwebkit-examples qtwebkit qtwebsockets qtxmlpatterns openssh-sftp-server gdb gdbserver"
Would you have an idea how to fix the issue ?
Cheers,
David