I am trying to run hello world example project in colibrivf61 with 2.6 image. The error still occurs after including sysroot. Please help
akn@akn-Vostro-2420:~/hello_world$ export CROSS_COMPILE=~/oe-core/build/out-glibc/sysroots/x86_64-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-
akn@akn-Vostro-2420:~/hello_world$ ${CROSS_COMPILE}gcc --sysroot=~/oe-core/build/out-glibc/sysroots/colibri-vf -mfloat-abi=hard -o hello_world hello_world.c
hello_world.c:1:64: fatal error: stdio.h: No such file or directory compilation terminated. akn@akn-Vostro-2420:~/hello_world$
You generated toolchain based on your build?
E.g.:
bitbake core-image-minimal -c meta-toolchain
Or
bitbake core-image-minimal -c populate_sdk
Then access tmp/deploy/sdk/ and install the toolchain on the host? It would be the correct way to cross-compiling with your host.
After install, normally located in /opt/poky/NUMBER_DISTRO_VERSION/ and you run source environment-setup-xxxxxx-poky-linux-gnueabi
.
More information:
Yocto Project Reference Manual
Yocto Project Reference Manual
Cleiton Bueno
Blog | Linkedin | B2Open
We would recommend building the SDK
bitbake -c populate_sdk angstrom-lxde-image
and then installing the SDK with
./out-glibc/deploy/sdk/angstrom-glibc-x86_64-armv7at2hf-vfp-neon-v2015.12-toolchain.sh -S
Assuming the standard installation paths for SDK, below command should work
/usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gcc --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi -mfloat-abi=hard -o hello hello.c
Alternatively one might also use a Makefile like below
CC = /usr/local/oecore-x86_64/sysroots/x86_64-angstromsdk-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-gcc
INCLUDES = -I/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/usr/include
LIB_PATH = -L/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/lib
LIBS = -lpthread
CFLAGS = -O2 -g -Wall -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-vfp-neon-angstrom-linux-gnueabi
all:
${CC} ${CFLAGS} ${INCLUDES} ${LIB_PATH} ${LIBS} hello.c -o hello
clean:
rm -rf hello