静态库的 Yocto 构建失败并出现错误 "No Match Found"
Yocto build for a static library fails with error "No Match Found"
我正在尝试在我为静态库编写的图像中包含 Yocto 配方。
- 在我自己的图层中创建了 recipes-test/static 文件夹。
- 在此文件夹中创建了 'static_0.1.bb' 个文件
- 在 'recipes-test/static' 文件夹中创建了 'files' 文件夹
- 复制了以下文件。
hello.c
char * hello (void)
{
return "Hello";
}
world.c
char *world(void)
{
return "World";
}
helloworld.h
#ifndef HELLOWORLD_H
#define HELLOWORLD_H
char * hello (void);
char * world (void);
#endif
- 创建了以下内容的配方:
描述 = "Simple helloworld example static library"
许可证 = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = " 文件://hello.c \
文件://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}
}
当我说 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"
来启用它
我正在尝试在我为静态库编写的图像中包含 Yocto 配方。
- 在我自己的图层中创建了 recipes-test/static 文件夹。
- 在此文件夹中创建了 'static_0.1.bb' 个文件
- 在 'recipes-test/static' 文件夹中创建了 'files' 文件夹
- 复制了以下文件。
hello.c
char * hello (void)
{
return "Hello";
}
world.c
char *world(void)
{
return "World";
}
helloworld.h
#ifndef HELLOWORLD_H
#define HELLOWORLD_H
char * hello (void);
char * world (void);
#endif
- 创建了以下内容的配方:
描述 = "Simple helloworld example static library"
许可证 = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = " 文件://hello.c \
文件://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}
}
当我说 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"