【发布时间】:2020-04-09 15:32:29
【问题描述】:
- C 文件
int main() {
printf("Hello, World!\n");
return 0;
}
- helloworld.bb
DESCRIPTION = "Recipe created by bitbake-layers"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://${BSPDIR}/poky/build-microchip/my_layer/recipes-example/helloworld/helloworld/helloworld.c"
S = "/home/user/my_dir/poky/build-microchip/conf"
do_compile() {
${CC} helloworld.c -o helloworld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
- 运行命令
bitbake helloworld
错误 do_compile() 块中的错误 helloworld.c 文件未找到
- 文件树
build-microchip/my_layer/recipes-examples/
└── helloworld
├── helloworld
│ └── helloworld.c
└── helloworld.bb
2个目录,2个文件
【问题讨论】:
-
您确定
${BSPDIR}/poky/build-microchip/my_layer/recipes-example/helloworld/helloworld/helloworld.c吗?主要在${BSPDIR}?通常文件位于放置 bb 文件的 files 子目录下。 -
只是为了仔细检查,您显示的“C 文件”的名称是什么?
标签: c cross-compiling yocto bitbake openembedded