[poky] compile application header file missing
Richard Purdie
richard.purdie at linuxfoundation.org
Tue Mar 15 06:38:06 PDT 2011
On Tue, 2011-03-15 at 11:57 +0100, Gerard van den Bosch wrote:
> Hello,
>
> I have programmed an application that uses the OpenSLP library and thus
> needs the header file from it.
> OpenSLP is already compiled and running fine on the target.
>
> But when I try to compile my application it can't find the header file.
> When I print out the CFLAGS with bitbake myimage -e | grep CFLAGS the
> BUILD_CFLAGS point to:
> /home/gerard/green-3.3/build/tmp/sysroots/i686-linux/usr/include
> The slp.h is indeed missing, but it is located at:
> /home/gerard/green-3.3/build/tmp/sysroots/armv7a-poky-linux-gnueabi/usr/include
>
> How can I change the CFLAGS to look in the other folder or force OpenSLP
> to drop it in the i686 folder?
>
> I have added OpenSLP to my DEPENDS in the recipe, also tried RDEPENDS
> but it didn't solve the problem.
You should be adding OpenSLP to DEPENDS. The toolchain should be
automatically searching the arm sysroot /usr/include directory for
include files which is where your file is.
I appreciate this is the green release, in master we have this in
meta/conf/bitbake.conf:
TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
Back in green, this option should be being hardcoded into gcc as the
default sysroot option but you could try explicitly setting it.
Note that BUILD_CFLAGS is the wrong place to look, those are for native
build tools, not target ones. You want to use TARGET_CFLAGS and
TARGET_CFLAGS should be the same as CFLAGS.
After reading the above, if your image *is* using BUILD_CFLAGS and
BUILD_CC instead of CC, that is your real problem, it should be using
the target device compiler, not the build one.
Cheers,
Richard
More information about the poky
mailing list