How to build .c file that include "gpiod.h" by using i.MX8M Plus SDK ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to build .c file that include "gpiod.h" by using i.MX8M Plus SDK ?

2,678 Views
Jimmychea
Contributor III

Hi,

In my coding, i will include "gpiod.h" in my .c file, but when i try cross compile it, terminal will pop out the error "unable locate the "gpiod.h"". So my question is how to install the library gpiod into SDK in order able to build my .c file.

 

Thanks

0 Kudos
Reply
2 Replies

2,657 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @Jimmychea 

I hope you are doing well.

->Please make sure the gpio.c file has the below line including the library file.
#include "gpio.h"

->One can also try to add a relative path into the .c file
for example:- #include "../file/file2/gpio.h"

->If the gpio.h is a global header file then please change the format as given below.
#include <gpio.h>

->Please make sure to add the code to the makefile.

->Please make sure to use the header files for x86 when cross-compiling instead of the aarch64 headers.

Please refer to the below link for more detail.
https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/kinetis/60106/1/Getting%20Started%20with...

Thanks & Regards.

Sanket Parekh

0 Kudos
Reply

2,652 Views
Jimmychea
Contributor III

include "linux/gpio.h" this should be able to use it in doing the linux kernel driver development, for what i want is actually using the GPIO on user space (high level API). Thanks

0 Kudos
Reply