我是Yocto的新手,
我有一个图书馆,我们称它为Lib1。 Lib1使用另一个库中的接口,称之为Lib2。
因此我将Lib2包含在Lib1中,并且可以正确编译。
现在我有一个使用Lib1的二进制文件,在构建此二进制文件时,在Lib1.so“ Lib2.h没有这样的文件或目录”中发生了错误。
我尝试解决此问题的步骤:
我在Lib1配方文件中添加了Lib2软件包:
取决于+ =“ Lib2”
Rdepends + =“ Lib2”
也在Lib1 Makefile中:
libs = -lLib2
Cflags = $(Lib2_cflags)
但是没有用。
错误消息:
1.0-r0 / recipe-sysroot = -c -o Bin-main.o
test -f 'main.c' || echo '../../git/Bin/src/'
main.c |在包含的文件中 ../../git/Bin/src/main.c:15:0:| /home/build/tmp/work/Bin/1.0-r0/recipe-sysroot/usr/include/Lib1.h:32:33: 致命错误:Lib2:没有这样的文件或目录#include“ Lib2.h”
Lib1食谱:
DESCRIPTION = "Lib1"
PR = "r0"
SRC_URI = ""
DEPENDS = "Lib2"
RDEPENDS_${PN} += "Lib2"
RDEPENDS_${PN}-dev += "Lib2"
S = "${WORKDIR}/git/"
EXTRA_OECMAKE = "-DWITH_SYSTEMD=ON"
inherit autotools pkgconfig systemd
INSANE_SKIP_${PN} = "dev-so"
PACKAGES += "${PN}-test"
FILES_${PN} += "${libdir}/*.so* ${sysconfdir}/* ${libdir}/pkgconfig/*"
FILES_${PN}-dev += "${srcdir}/* ${includedir}/* ${libdir}/pkgconfig/* ${libdir}/*.so"
FILES_${PN}-test += "${bindir}/*
Lib2食谱:
SUMMARY = "Lib2"
PR = "r1"
LICENSE = "CLOSED"
DEPENDS = ""
SRC_URI = ""
S = "${WORKDIR}/git"
inherit autotools pkgconfig
INSANE_SKIP_${PN} = "dev-so"
FILES_${PN} = "${libdir}/Lib2.so*"
FILES_${PN}-dev = "${srcdir}/* ${includedir}/* ${libdir}/pkgconfig/*"
FILES_${PN}-staticdev = "${libdir}/*.a"
二进制文件配方:
DESCRIPTION = "Binary"
PR = "r0"
LICENSE = "CLOSED"
DEBIAN_NOAUTONAME_${PN}-test = "1"
SRC_URI = ""
DEPENDS = "Lib1"
S = "${WORKDIR}/git/"
inherit autotools pkgconfig systemd
INSANE_SKIP_${PN} += "installed-vs-shipped"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "Bin.service"
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
EXTRA_OECMAKE = "-DWITH_SYSTEMD=ON"
FILES_${PN} += " ${sysconfdir}/system.d/*"