Disclaimer: I haven't written and compiled a C program in over 20 years.
This is probably something very simple, but I'm stuck. Can someone point out my error?
Compile/Link command:
Linker error:
libgpio exists (and is part of the FreeBSD 11 distribution for Rpi B+)
Program source code:
This is probably something very simple, but I'm stuck. Can someone point out my error?
Compile/Link command:
cc -v -llibgpio act.c -o act
Linker error:
Code:
/usr/bin/ld: cannot find -llibgpio
cc: error: linker command failed with exit code 1 (use -v to see invocation)
libgpio exists (and is part of the FreeBSD 11 distribution for Rpi B+)
Code:
root@garagepi:/home/rmorgan # locate libgpio
/usr/include/libgpio.h
/usr/lib/libgpio.a
/usr/lib/libgpio.so
/usr/lib/libgpio.so.0
/usr/lib/libgpio_p.a
Program source code:
Code:
#include <sys/types.h>
#include <err.h>
#include <libgpio.h>
int main() {
gpio_handle_t handle;
handle = gpio_open(0);
if (handle == GPIO_INVALID_HANDLE)
err(1, "gpio_open failed");
gpio_pin_output(handle, 47);
gpio_pin_high(handle, 47);
gpio_close(handle);
}