取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
Highlighted
Newbie
Newbie
585 次查看
注册日期: ‎05-21-2019

petalinux-2018.3 on ubuntu 16.04 , when use petalinux-build , can't find the head file

跳至解决方案

what I had done is below:

1. petalinux-create -t project --template zynq -n test

2. petalinux-config --get-hw-description==.sdk

3. petalinux-build (this step is ok)

4. petalinux-package --boot --fsbl image/linux/zynq-fsbl.elf --fpga image/linux/system.bit --u-boot

5. petalinux-create -t apps -n xhead --enable

6. petalinux-build (this step is still ok)

7. add a blank head file "test.h" in the /project-spec/meta-user/recipes-apps/xhead/files

8. add "#include test.h" in the c file xhead.c

9. petalinux-build (this step will report the error : xhead.c:29:10: fatal error: test.h: No such file or directory)

 

what's wrong with my petalinux-2018.3 ?? new petalinux project and new added app, just can't find the head file!

0 项奖励
1 解答

已接受的解答
Highlighted
Newbie
Newbie
460 次查看
注册日期: ‎05-21-2019

hi, @weiyil

thanks for your help.

Finally I found the solution, petalinux2018.3 is different from petalinux 2015.4 that I used. when using petalinux2018.3, for adding source code into the petalinux project , we have to add the path of the source code into the xxx.bb file (which in the <plnx_directory>/project-spec/meta-user/recipes/myapp) at the same time.

在原帖中查看解决方案

4 回复数
Highlighted
Moderator
Moderator
559 次查看
注册日期: ‎05-23-2018

Hi, @david_joson 

Are "test.h" and "xhead.c" in the same directory?

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 项奖励
Newbie
Newbie
509 次查看
注册日期: ‎05-21-2019

Yes,the file "test.h" and "xhead.c" are in the same directory ! just can't find "test.h". I tried ubuntu 18.04.1 and petalinux 2019.1 , when I build the project , report the same error.

 

log.do_compile.12262  is below:

DEBUG: Executing shell function do_compile
NOTE: make -j 4
arm-xilinx-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/liwei/work/MultiX_head/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/xhead/1.0-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/liwei/work/MultiX_head/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/xhead/1.0-r0=/usr/src/debug/xhead/1.0-r0 -fdebug-prefix-map=/home/liwei/work/MultiX_head/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/xhead/1.0-r0/recipe-sysroot= -fdebug-prefix-map=/home/liwei/work/MultiX_head/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/xhead/1.0-r0/recipe-sysroot-native= -c -o xhead.o xhead.c
xhead.c:29:10: fatal error: test.h: No such file or directory
#include "test.h"
^~~~~~~~
compilation terminated.
make: *** [<builtin>: xhead.o] Error 1
ERROR: oe_runmake failed
WARNING: /home/liwei/work/MultiX_head/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/xhead/1.0-r0/temp/run.do_compile.12262:1 exit 1 from 'exit 1'
ERROR: Function failed: do_compile (log file is located at /home/liwei/work/MultiX_head/build/tmp/work/cortexa9t2hf-neon-xilinx-linux-gnueabi/xhead/1.0-r0/temp/log.do_compile.12262)

 

0 项奖励
Highlighted
Moderator
Moderator
497 次查看
注册日期: ‎05-23-2018

Hi, @david_joson 

Try to modify the makefile, using the "-I" option to specify the directory of header files. See if that can help.

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 项奖励
Highlighted
Newbie
Newbie
461 次查看
注册日期: ‎05-21-2019

hi, @weiyil

thanks for your help.

Finally I found the solution, petalinux2018.3 is different from petalinux 2015.4 that I used. when using petalinux2018.3, for adding source code into the petalinux project , we have to add the path of the source code into the xxx.bb file (which in the <plnx_directory>/project-spec/meta-user/recipes/myapp) at the same time.

在原帖中查看解决方案