gpt4 book ai didi

linux - 静态库的 Yocto 构建失败,错误为 "No Match Found"

转载 作者:太空宇宙 更新时间:2023-11-04 10:00:15 32 4
gpt4 key购买 nike

我正在尝试在我为静态库编写的图像中包含 Yocto 配方。

  1. 在我自己的图层中创建了 recipes-test/static 文件夹。
  2. 在此文件夹中创建“static_0.1.bb”文件
  3. 在“recipes-test/static”文件夹中创建了“files”文件夹
  4. 复制了以下文件。

你好.c

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

世界.c

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

helloworld.h

#ifndef HELLOWORLD_H
#define HELLOWORLD_H
char * hello (void);
char * world (void);
#endif
  1. 创建了包含以下内容的食谱:

DESCRIPTION = "简单的 helloworld 示例静态库" 许可证 = "麻省理工学院" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "文件://hello.c\ 文件://world.c\ 文件://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}
}

当我说 bitbake static 时,静态库是在 tmp/work 文件夹中创建的

当我使用以下行将其包含在 conf/local.conf 文件中时:IMAGE_INSTALL_append = "静态"

构建在根文件创建阶段失败并出现以下错误:

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

你能帮我解决这个错误吗

更新:更改 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 会自动将安装在 ${D} 中的文件拆分成不同的包。在你的情况下,helloworld.h 将进入 ${PN}-dev(${PN} 在你的情况下等于静态,但我写 ${PN} 以避免混淆)和 libhelloworld.a 将进入 ${PN}-staticdev,但由于没有其他文件,因此不会有名为 ${PN} 的包,因为它会是空的。

如果您真的希望静态库最终出现在图像中,请使用 IMAGE_INSTALL_append = "static-staticdev"

还有一个问题是没有文件会包含在普通的 ${PN} 包中,默认设置意味着不会创建这样的包。这是一个问题,因为 ${PN}-dev 包在运行时依赖于 ${PN}。这可以通过允许创建 ${PN} 来解决,即使它是空的,通过添加 ALLOW_EMPTY_${PN} = "1"

来启用它

关于linux - 静态库的 Yocto 构建失败,错误为 "No Match Found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56845122/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com