我对Petalinux的2020.2版本非常陌生,我正在尝试使用C模板在我的项目中创建一个简单的应用程序。
在使用以下命令创建helloworld-app之后:
petalinux-create -t apps --template c --name helloworld-app在启用默认应用程序并成功构建它之后,我尝试在helloworld-app/文件(称为以太网)下创建一个新目录,其中包含两个文件Etherent.c和Ethernet.h,从而添加了一些功能。
最后,我将Ethernet.o对象添加到模块自动生成的Makefile中的列表中,为了简单起见,我还添加了一个VPATH。
不幸的是,构建失败了,实际上bitbake告诉我没有为对象Ethernet.o指定任何规则。
谢谢你的支持!E.c:
#include "Ethernet.h"
//some C codehelloworld-app.c:
#include <stdio.h>
#include "Ethernet/Ethernet.h"
//some C codeMakefile:
APP = helloworld-app
VPATH=Ethernet
# Add any other object files to this list below
APP_OBJS = helloworld-app.o Ethernet.o
all: build
build: $(APP)
$(APP): $(APP_OBJS)
$(CC) -o $@ $(APP_OBJS) $(LDFLAGS) $(LDLIBS)
clean:
rm -f $(APP) *.o下面我包含了petalinux-build -c helloworld-app命令的输出:

发布于 2021-03-31 13:39:41
一个简单的解决方案,但如果文件数量增加,实际上很麻烦,就是简单地将源文件的路径添加到SRC_URI文件中的变量.bb。我将不接受这个问题的答案,等待一个更可持续的解决办法。感谢大家!
https://stackoverflow.com/questions/66692705
复制相似问题