Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4848

General discussion • Building C with libgpiod

$
0
0
I am having trouble getting a simple test C program to build with libgpiod.

I have installed gpiod and libgpiod-dev

The library files are in /usr/lib/aarch64-linux-gnu

I can compile my program and it finds gpiod.h, good so far

When I try to link it with

gcc -l gpiod -o main main.c

I get "main.c:(.text+0x20): undefined reference to `gpiod_chip_open_by_name'" and the same for all function calls.

If I change the name of the library to something else that doesn't exist it complains so I know it is finding libgpiod.a. Why can't it find the functions within that library?

Statistics: Posted by Mikerb999 — Sun Jul 21, 2024 6:58 am



Viewing all articles
Browse latest Browse all 4848

Trending Articles