Cross compiling libgpiod is not working

Dear Toradex,

I cannot compile a C object file for the Colibri IMX6 that includes the library gpiod.h: no such file or directory. The toolchain from the quick-start guide is sourced and gpiod is installed using the package manager (apt) in Ubuntu (the host).

This is the command for compiling the code:
${CC} test_program.c -o test_program -lgpiod

And as output I get:

fatal error: gpiod.h: No such file or directory
 #include <gpiod.h>
compilation terminated.

In the gcc command it’s specific library is also linked using “-lgpiod” like this, and works for the host machine.
$gcc test_program.c -o test_program -lgpiod

SoM: Colibri iMX6ULL 512MB IT
Carrier: Colobri Evaluation Board
OS: Toradex Embedded Linux Reference Multimedia Image


Toolchain you are using perhaps doesn’t include ligpiod.a library and gpiod.h header. Perhaps there’s an easy way solve it, but I’m using instead armhf toolchain from Ubuntu. Then I just add missing part like this.

sudo apt install libgpiod-dev:armhf



Thank you for your response, I think this might be the solution, I had the library installed for my host computer which is 64 bit. So your solution might work.


Hi @rjjong1 !

Did you manage to solve the issue?

Best regards,