[yocto] Yocto SDK generated - unable to compile application

Evan O'Loughlin evan.oloughlin at vitalograph.ie
Thu Sep 20 02:40:58 PDT 2018


Hi Bas,

I'm using the offending line in helloworld.c to highlight the issue I'm seeing.

My main program is a Qt application where I see the same issue when trying to build in QtCreator.

My issue relates to the fact that several include files are not readily available after 'sourcing' the environment setup.

Do I need to adjust/include other recipes when building the SDK?

Regards,
Evan

-----Original Message-----
From: Bas Mevissen [mailto:abuse at basmevissen.nl] 
Sent: 20 September 2018 10:12
To: Evan O'Loughlin <evan.oloughlin at vitalograph.ie>
Cc: yocto at yoctoproject.org
Subject: Re: [yocto] Yocto SDK generated - unable to compile application

On 2018-09-20 10:08, Evan O'Loughlin wrote:
> Hello,
> 
> I’m having an issue when I try to use the SDK generated by my yocto 
> instance.
> Currently I have yocto set-up to correctly build my image – this all 
> works well.
> 
> I've built the SDK in the following ways:
>    * bitbake {image} –c populate_sdk
>    * bitbake meta-toolchain-qt5
>    * bitbake {image-sdk} using a separate recipe with the options:
>        - require {image}.bb
>        - IMAGE_FEATURES += " dev-pkgs tools-sdk tools-debug 
> eclipse-debug debug-tweaks"
>        - IMAGE_INSTALL += "kernel-devsrc"
>        - inherit populate_sdk populate_sdk_qt5
> 
> 
> When I try to use the generated SDKs I get the error below:
> Simple helloworld app:
>    #include <stdio.h>
>    #include <stdlib.h>
>    #include <stddef.h>
>    #include <cstddef>
> 
>    int main (int argc, char** argv)
>    {
>       printf("Hello World\n");
>       return 0;
>    }
> 
> Compile error:
>    ${CC} helloworld.c
>    helloworld.c:4:19: fatal error: cstddef: No such file or directory
>    #include <cstddef>
>                     ^
>    compilation terminated
> 
> 
> Have I missed a step in generating the SDK?
> 
> 

No, your SDK looks fine. The solution is to just remove the line

#include <cstddef>

from your c sources or use the g++ compiler (called ${CXX) in Makefile) to compile the source.

> Regards,
> vitalEol



More information about the yocto mailing list