From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id D2235E00BD2; Thu, 20 Sep 2018 05:24:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from hosting.emcodev.net (hosting.emcodev.net [178.18.92.162]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id CD757E00BAA for ; Thu, 20 Sep 2018 05:24:13 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by hosting.emcodev.net (Postfix) with ESMTP id 24E8812AE49; Thu, 20 Sep 2018 14:24:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at hosting.emcodev.net Received: from hosting.emcodev.net ([127.0.0.1]) by localhost (hosting.emcodev.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YiR6nfPXiCJB; Thu, 20 Sep 2018 14:23:31 +0200 (CEST) Received: from emcodev.nl (localhost [127.0.0.1]) by hosting.emcodev.net (Postfix) with ESMTP id A115012AE53; Thu, 20 Sep 2018 14:23:07 +0200 (CEST) MIME-Version: 1.0 Date: Thu, 20 Sep 2018 14:23:06 +0200 From: Bas Mevissen To: Evan O'Loughlin In-Reply-To: <2EE3E45FEAD8944697CC29BFE83DD70F289B931C@VitalExchange.vitalograph.local> References: <2EE3E45FEAD8944697CC29BFE83DD70F289B91F2@VitalExchange.vitalograph.local> <2EE3E45FEAD8944697CC29BFE83DD70F289B92E6@VitalExchange.vitalograph.local>, <2EE3E45FEAD8944697CC29BFE83DD70F289B931C@VitalExchange.vitalograph.local> Message-ID: <47ce2f8e897e9f02943c4f9884e85488@basmevissen.nl> X-Sender: abuse@basmevissen.nl User-Agent: Roundcube Webmail/1.3.7 Cc: yocto@yoctoproject.org Subject: Re: Yocto SDK generated - unable to compile application X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2018 12:24:15 -0000 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 2018-09-20 12:28, Evan O'Loughlin wrote: > ________________________________________ > From: Bas Mevissen [abuse@basmevissen.nl] > Sent: 20 September 2018 10:50 > To: Evan O'Loughlin > Cc: yocto@yoctoproject.org > Subject: Re: [yocto] Yocto SDK generated - unable to compile=20 > application >=20 > On 2018-09-20 11:40, Evan O'Loughlin wrote: >> -----Original Message----- >> From: Bas Mevissen [mailto:abuse@basmevissen.nl] >> Sent: 20 September 2018 10:12 >> To: Evan O'Loughlin >> Cc: yocto@yoctoproject.org >> Subject: Re: [yocto] Yocto SDK generated - unable to compile >> application >>=20 >> On 2018-09-20 10:08, Evan O'Loughlin wrote: >>> Hello, >>>=20 >>> I=E2=80=99m 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 =E2=80=93 t= his all >>> works well. >>>=20 >>> I've built the SDK in the following ways: >>> * bitbake {image} =E2=80=93c populate_sdk >>> * bitbake meta-toolchain-qt5 >>> * bitbake {image-sdk} using a separate recipe with the options: >>> - require {image}.bb >>> - IMAGE_FEATURES +=3D " dev-pkgs tools-sdk tools-debug >>> eclipse-debug debug-tweaks" >>> - IMAGE_INSTALL +=3D "kernel-devsrc" >>> - inherit populate_sdk populate_sdk_qt5 >>>=20 >>>=20 >>> When I try to use the generated SDKs I get the error below: >>> Simple helloworld app: >>> #include >>> #include >>> #include >>> #include >>>=20 >>> int main (int argc, char** argv) >>> { >>> printf("Hello World\n"); >>> return 0; >>> } >>>=20 >>> Compile error: >>> ${CC} helloworld.c >>> helloworld.c:4:19: fatal error: cstddef: No such file or directory >>> #include >>> ^ >>> compilation terminated >>>=20 >>>=20 >>> Have I missed a step in generating the SDK? >>>=20 >>>=20 >>=20 >> No, your SDK looks fine. The solution is to just remove the line >>=20 >> #include >>=20 >> from your c sources or use the g++ compiler (called ${CXX) in >> Makefile) to compile the source. >>=20 >>> Regards, >>> vitalEol >=20 >> Hi Bas, >>=20 >> I'm using the offending line in helloworld.c to highlight the issue=20 >> I'm >> seeing. >>=20 >> My main program is a Qt application where I see the same issue when >> trying to build in QtCreator. >>=20 >> My issue relates to the fact that several include files are not >> readily available after 'sourcing' the environment setup. >>=20 >> Do I need to adjust/include other recipes when building the SDK? >>=20 >=20 > I might be wrong, but this looks like you are using the gcc compiler > instead of the g++ one. See the second part of my answer. >=20 > To check your environment, check in your sdk that the file cstddef > exists somewhere in /usr/include. Example from a Fedora Linux system: >=20 > $ find /usr/include -name cstddef > /usr/include/c++/8/cstddef >=20 > If I compile your example with "gcc" on that system, I get the same > error. With "g++", is is fine. It automatically find the cstddef header > file in the /usr/include/c++/8 directory. >=20 > Hope this helps, >=20 > (and please do not top post as that makes a mail thread unreadable) >=20 > -- Bas. >=20 >=20 >> Regards, >> Evan >>=20 >=20 > Hi Bas, >=20 > Apologies for top-posting previously. >=20 > using ${CC}, ${CPP} or ${CXX} all show the same error relating to not > finding the required include >=20 > cstddef is available in the cross-compiler toolchain: > $ find . -name cstddef > ./sysroots/armv7ahf-neon-linux-gnueabi/usr/include/c++/6.2.1/cstddef > ./sysroots/armv7ahf-neon-linux-gnueabi/usr/include/boost/compatibility/= cpp_c_headers/cstddef >=20 That looks fine. > and is also available on my system: > $ find /usr/include -name cstddef > /usr/include/c++/5/cstddef > /usr/include/c++/4.7/cstddef > /usr/include/c++/4.8/cstddef >=20 >=20 > ${CC} --version && ${CPP} --version && ${CXX} --version > arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016 > Copyright (C) 2016 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is= =20 > NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR=20 > PURPOSE. >=20 > arm-linux-gnueabihf-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016 > Copyright (C) 2016 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is= =20 > NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR=20 > PURPOSE. >=20 > arm-linux-gnueabihf-g++ (Linaro GCC 6.2-2016.11) 6.2.1 20161016 > Copyright (C) 2016 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is= =20 > NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR=20 > PURPOSE. >=20 I tried with an Freescale i.MX6 SDK for Sumo and that compiled fine with=20 ${CXX}. It is a bit of guessing now. Maybe somewhat more information might help: What version of Yocto are you using? What layers are included? What=20 machine? Are you sure this is the cross compiler belonging to the SDK? Did you maybe move the SDK install location and not adapt the=20 environment file? Please check this with "echo ${SDKTARGETSYSROOT}" and "echo ${CXX}" >=20 > Regards, > Evan