cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
2,200 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
7 Replies
Highlighted
Voyager
Voyager
2,184 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
Highlighted
Visitor
Visitor
1,186 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
Highlighted
Visitor
Visitor
1,185 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
Highlighted
Moderator
Moderator
1,173 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
Highlighted
Visitor
Visitor
1,171 Views
Registered: ‎10-08-2018

Thanks. This worked: SRC_URI := "file://${THISDIR}/include"
0 Kudos
Moderator
Moderator
1,162 Views
Registered: ‎09-12-2007

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

0 Kudos
Highlighted
Visitor
Visitor
1,160 Views
Registered: ‎10-08-2018

It's not my thread to resolve, I hijacked it :)
0 Kudos