cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dtubbs
Contributor
Contributor
3,276 Views
Registered: ‎07-01-2016

HowTo Add -I/path/to/include/folder to PetaLiunx 2018.2 Yocto build

Greetings,

 

I've added an app to my PetaLinux 2018.2 project, copied some source files into it, and I'm trying to build but failing.  The build error indicates it can't find a header file.

 

So I edited the Makefile in project-spec/meta-user/recipes-apps/myappname/files, and added the appropriate -I /path/to/include/folder on $(CC) compile line.  But when I build, the compiler still can't find the file, and it looks like the -I entry isn't being added to the compile operation.

 

How do I do this in the Yocto/BitBake world?

 

Thanks for your help!

 

-Dave

 

0 Kudos
8 Replies
hokim
Scholar
Scholar
3,260 Views
Registered: ‎10-21-2015

Hi

Remove -I path from your Makefile

Instead, you can add header files or folder to SRC_URI like SRC_URI += "file://*.h" or SRC_URI += "file://include_folder/"

 

0 Kudos
gkuhn
Visitor
Visitor
2,262 Views
Registered: ‎10-08-2018

"SRC_URI", at least in my app is a list of files prefixed with "file://". These files are all within a "files" directory. How can I add an include directory? Where do I put it? You mention "file://include_folder/" but where is this include folder relative to?
0 Kudos
gkuhn
Visitor
Visitor
2,261 Views
Registered: ‎10-08-2018

Ideally, I'd like to have the include directory either as a child of the files directory, or adjacent within the source hierarchy.
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
2,249 Views
Registered: ‎09-12-2007

You can place this anywhere. If you want to have it in the same dir, then use "SRC_URI := ${THISDIR}"

0 Kudos
gkuhn
Visitor
Visitor
2,247 Views
Registered: ‎10-08-2018

Thanks. This worked: SRC_URI := "file://${THISDIR}/include"
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
2,238 Views
Registered: ‎09-12-2007

Ok, great. Can you mark this as solved please?

0 Kudos
gkuhn
Visitor
Visitor
2,236 Views
Registered: ‎10-08-2018

It's not my thread to resolve, I hijacked it :)
0 Kudos
petalinx_newbie
Visitor
Visitor
724 Views
Registered: ‎02-23-2021

Do I also need to add this in .bb file?

do_install_append() {
install -d ${D}${bindir}
install -m 0755 ${S}/setup.py ${D}${bindir}
}

 

0 Kudos