Re: yocto compile simple c++


I see.  If you're going to provide the license with the recipe or code, then it needs to be in a subdirectory under the recipe file.  So the only one in your tree that matters for this is .../recipes-ice/files/COPYING.MIT.

Then you will need to explicitly list it in SRC_URI:
SRC_URI = "${SITE}${PN}.cpp \

An alternative, for common licenses, is to use a link like this:
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

You will still need this for your recipe to find the license or your source file:
S = "${WORKDIR}"


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Sunday, August 9, 2020 2:48 AM, Sergey Ivanov <icegood1980@...> wrote:

Hi. Unfortunately i tried it and it is not my case. To be precise, i don't see COPYING.MIT at any sibfolder of 
at all...

сб, 8 авг. 2020 г. в 14:31, codusnocturnus via <>:
Bitbake is unable to find the license file because it's looking in the wrong place.  If you look at the contents of /media/ice/slow_ext4/yocto_poky/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/ice_helloworld/helloworld-0.1/ice_helloworld-helloworld/ , you will probably find it to be empty, and you will find COPYING.MIT in the directory above it.

The reason is that ${S} (see to a location where a tarball would be unpacked, but your recipe isn't using a tarball.

Add the following to your recipe:
S = "${WORKDIR}"


Sent with ProtonMail Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, August 8, 2020 2:12 AM, Sergey Ivanov <icegood1980@...> wrote:

Hi there.
I'm newbie ib yocto and (of course) nothing works for me from scratch.
For testing purposes, i work with yocto 3.1 based on 5d47cdf448b6cff5bb7cc5b0ba0426b8235ec478 rev aka dunfell-23.0.0
MACHINE ?= "qemuarm" and DISTRO ?= "poky" (btw i tried poky-tony as well but machine didn't start properly under qemu)

I created my new layer with next structure:
├── conf
│   └── layer.conf
└── recipes-ice
    └── ice_helloworld
        ├── COPYING.MIT
        ├── files
        │   ├── COPYING.MIT
        │   └── ice_helloworld.cpp

(i copied COPYING.MIT to )every single place because of error below) and i obtained:

NOTE: Executing Tasks
WARNING: ice_helloworld-helloworld-0.1 do_populate_lic: Could not copy license file /media/ice/slow_ext4/yocto_poky/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/ice_helloworld/helloworld-0.1/ice_helloworld-helloworld/COPYING.MIT to /media/ice/slow_ext4/yocto_poky/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/ice_helloworld/helloworld-0.1/license-destdir/ice_helloworld/COPYING.MIT: [Errno 2] No such file or directory: '/media/ice/slow_ext4/yocto_poky/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/ice_helloworld/helloworld-0.1/ice_helloworld-helloworld/COPYING.MIT'
ERROR: ice_helloworld-helloworld-0.1 do_populate_lic: QA Issue: ice_helloworld: LIC_FILES_CHKSUM points to an invalid file: /media/ice/slow_ext4/yocto_poky/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/ice_helloworld/helloworld-0.1/ice_helloworld-helloworld/COPYING.MIT [license-checksum]
ERROR: ice_helloworld-helloworld-0.1 do_populate_lic: Fatal QA errors found, failing task.
ERROR: Logfile of failure stored in: /media/ice/slow_ext4/yocto_poky/build/tmp/work/armv7vet2hf-neon-poky-linux-gnueabi/ice_helloworld/helloworld-0.1/temp/log.do_populate_lic.133477
ERROR: Task (/media/ice/slow_ext4/yocto_poky/meta-ice_layer/recipes-ice/ice_helloworld/ failed with exit code '1'
NOTE: Tasks Summary: Attempted 216 tasks of which 214 didn't need to be rerun and 1 failed.

my bb file is:

SUMMARY = "Recipe to build the 'helloworld' in cpp"
SECTION = "ice"

PN = "ice_helloworld"
PV = "0.1"

SITE = "file://"
PACKAGE_VERSION_MAJOR = "${'PV',d,1).split('.')[0]}"
PACKAGE_VERSION_MINOR = "${'PV',d,1).split('.')[1]}"

SRC_URI = "${SITE}${PN}.cpp"
SRC_URI[md5sum] = "bc9dc64a44f9685d0310b94400a4631c"
SRC_URI[sha256sum] = "789e60072ea96371a35d5653d664b4c4b91e80ce2ea6d523d6caedab06a07a2a"
LIC_FILES_CHKSUM = "${SITE}COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

do_compile() {
    ${CXX} ${PN}.cpp -o ${PN}

do_install() {
    install -d ${D}${bindir}
    install -m 0755 ${PN} ${D}${bindir}
what could be wrong here?
Kind regards,
Sergey Ivanov

Kind regards,
Sergey Ivanov

Join to automatically receive all group messages.