简体   繁体   English

Yocto为静态库构建失败,并显示错误“找不到匹配项”

[英]Yocto build for a static library fails with error “No Match Found”

I am trying to include a Yocto recipe in the image which I wrote for static library. 我试图在为静态库编写的图像中包含Yocto食谱。

  1. Created recipes-test/static folder in my own layer . 在我自己的图层中创建了recipes-test / static文件夹。
  2. Created 'static_0.1.bb' file in this folder 在此文件夹中创建了“ static_0.1.bb”文件
  3. Created 'files' folder inside the 'recipes-test/static' folder 在“ recipes-test / static”文件夹中创建的“ files”文件夹
  4. Copied the below files. 复制了以下文件。

hello.c 你好ç

char * hello (void)
{
  return "Hello";
}

world.c world.c

char *world(void)
{
  return "World";
}

helloworld.h helloworld.h

#ifndef HELLOWORLD_H
#define HELLOWORLD_H
char * hello (void);
char * world (void);
#endif
  1. Created recipe with the following content: 创建的配方具有以下内容:

DESCRIPTION = "Simple helloworld example static library" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" description =“简单的helloworld示例静态库” LICENSE =“ MIT” LIC_FILES_CHKSUM =“ file:// $ {COMMON_LICENSE_DIR} / MIT; md5 = 0835ade698e0bcf8506ecda2f7b4f302”
SRC_URI = " file://hello.c \\ file://world.c \\ file://helloworld.h " SRC_URI =“ file://hello.c \\ file://world.c \\ file://helloworld.h”

S = "${WORKDIR}"

do_compile() {
        ${CC} -c hello.c world.c
        ${AR} -cvq libhelloworld.a hello.o world.o
}

do_install() {
        install -d ${D}${includedir}
        install -d ${D}${libdir}
        install -m 0755 helloworld.h ${D}${includedir}
        install -m 0755 libhelloworld.a ${D}${libdir}
}

When i say bitbake static , static library is created in the tmp/work folder 当我说bitbake static ,会在tmp / work文件夹中创建静态库

When i included it in conf/local.conf file with the following line: IMAGE_INSTALL_append = " static" 当我将它包含在conf / local.conf文件中并带有以下行时:IMAGE_INSTALL_append =“ static”

The build fails at the root file creating stage with the following error: 生成在根文件创建阶段失败,出现以下错误:

not found other for: 
not found modules for: 
not found deltainfo for: 
not found updateinfo for: 
oe-repo: using metadata from Tue 02 Jul 2019 03:54:50 AM UTC.
No module defaults found
No match for argument: static
Error: Unable to find a match

Can you please help me to resolve the error 您能帮我解决错误吗

Update: After changing IMAGE_INSTALL_append = " static-staticdev", i get the following error: 更新:更改IMAGE_INSTALL_append =“ static-staticdev”后,出现以下错误:

No module defaults found
--> Starting dependency resolution
--> Finished dependency resolution
Error: 
 Problem: package static-staticdev-0.1-r0.cortexa7t2hf_neon_vfpv4 requires static-dev = 0.1-r0, but none of the providers can be installed
  - conflicting requests
  - nothing provides static = 0.1-r0 needed by static-dev-0.1-r0.cortexa7t2hf_neon_vfpv4
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Yocto will automatically split up the files installed in ${D} into different packages. Yocto会自动将${D}安装的文件拆分为不同的软件包。 In your case the helloworld.h will go into ${PN}-dev ( ${PN} equals static in your case, but I write ${PN} to avoid confusion) and libhelloworld.a will go into ${PN}-staticdev , but since there's no other files there will not be a package called ${PN} since it would be empty. 在您的情况下,helloworld.h将进入${PN}-dev (在您的情况下, ${PN}等于静态,但是我写了$ {PN}以避免混淆),而libhelloworld.a将进入${PN}-staticdev ,但是由于没有其他文件,因此将没有名为${PN}的软件包,因为它将为空。

If you really want the static library to end up in the image, use IMAGE_INSTALL_append = "static-staticdev" 如果您确实希望静态库最终出现在映像中,请使用IMAGE_INSTALL_append = "static-staticdev"

There's also a problem that there is no file that will be included in the plain ${PN} package, which with the default settings means that no such package will be created. 还有一个问题是,普通的${PN}软件包中没有文件,这是默认设置,意味着不会创建任何此类软件包。 This is a problem since the ${PN}-dev package has a runtime dependency on ${PN} . 这是一个问题,因为${PN}-dev软件包对${PN}具有运行时依赖性。 This can be solved by allowing the creation of ${PN} even if it's empty, enable this by adding ALLOW_EMPTY_${PN} = "1" 可以通过允许${PN}创建(即使它为空)来解决,可以通过添加ALLOW_EMPTY_${PN} = "1"启用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM