我有一个层,它在 Yocto 构建的发行版的目录中创建共享库 ( libbbexample.so) 。usr/lib该库包含多个函数。
因此,我创建了一个新层,在其中编写了一个程序,该程序将使用libbbexample.so.
文件helloworld.c:
#incude<stdio.h>
#include<bbexample.h>
int main()
{
int data;
data = get_data(); // this function is present in libbbexample.so
printf("data is %d",data);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
所以我尝试对新图层进行bitbake,但出现错误"cannot find -libbbexample"。
新层.bb文件内容如下
do_compile() {
${CC} helloworld.c -o helloworld -libbbexample ${LDFLAGS}
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
Run Code Online (Sandbox Code Playgroud)
我为图层设置了以下优先级:
libbbexample.so)的优先级为7。谢谢