todbot / blink1-tool

Command-line tools and C library for blink(1) USB RGB LED
https://blink1.thingm.com/
Other
84 stars 15 forks source link

libusb dependency not handled #22

Closed ITCMD closed 4 years ago

ITCMD commented 5 years ago

The corrosponding libusb version required for libusb.h is not found on most machines, and is not handled by the make script for blink1-tool. The following error occured:

setlucas@SetLucas-Lenovo-Z70-KDE:~/blink1-tool$ sudo make
Building blink1-tool for OS=linux BLINK1_VERSION=v2.0.3-linux-x86_64 USBLIB_TYPE=HIDAPI
Type 'make help' for other build products
gcc -DUSE_HIDAPI -I./hidapi/hidapi `pkg-config libusb-1.0 --cflags` -fPIC -std=gnu99 -DBLINK1_VERSION=\"""v2.0.3"-linux-"x86_64""\" -c hidapi/libusb/hid.c -o hidapi/libusb/hid.o
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
hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
 #include "libusb.h"
          ^~~~~~~~~~
compilation terminated.
Makefile:518: recipe for target 'hidapi/libusb/hid.o' failed
make: *** [hidapi/libusb/hid.o] Error 1
setlucas@SetLucas-Lenovo-Z70-KDE:~/blink1-tool$

Solution for users: sudo apt-get install libusb-1.0-0-dev

Solution for dev install libusb-1.0-0-dev in the make script.

todbot commented 5 years ago

Hi,

blink1-tool will not install system-altering dependencies like that. This is something the admin should do. And while the dependencies are spelled out in the Makefile, I think it would be good to specify them in the README so it's obvious what one needs to get it to work.

Thanks, I think it should be made clearer than it is.

todbot commented 4 years ago

blink1-tool now uses hidraw instead of libusb. And README has been updated.