2
votes

I am trying to compile hidapi library. In order to compile that, I need libusb-1.0. I've downloaded that, configured, made and installed to /usr/local/lib. But when I try to compile hidapi, it doesn't see libusb-1.0:

cc -Wall -g -c -I../hidapi pkg-config libusb-1.0 --cflags hid-libusb.c -o hid-libusb.o -L/usr/local/lib Package libusb-1.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libusb-1.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libusb-1.0' found /bin/sh: cc: not found make: * [hid-libusb.o] Error 127

How can I fix that?

(compilation happens on Synology NAS)

1

1 Answers

4
votes

Since you installed to /usr/local/lib, pkg-config will not find your installation unless you set PKG_CONFIG_PATH appropriately

Try running:

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"

in your shell and then re-attempting to build your code