0

I'm working on a project that utilizes the Yepkit USB Switchable Hub, but keep encountering a problem when attempting to build the Yepkit program on my Raspberry pi running Raspbian Jessie Lite.

The documentation says to:

sudo apt-get install libusb-1.0-0-dev  
sudo apt-get install libusb-1.0-0  

both return saying I have the newest version.

The next step says to pull the github source code, which I did using:

git clone https://github.com/Yepkit/ykush.git

then changed to the ykush directory and attempt the build

sudo ./build.sh

This resulted in the following error:

sudo ./build.sh 
Checking for git...
Fetching latest version of hidapi...
Cloning into 'hidapi'...
remote: Counting objects: 2006, done.
remote: Total 2006 (delta 0), reused 0 (delta 0), pack-reused 2006
Receiving objects: 100% (2006/2006), 2.72 MiB | 1.15 MiB/s, done.
Resolving deltas: 100% (1174/1174), done.
Checking connectivity... done.
Building hidapi...
make: Entering directory '/home/atticakes/ykush/hidapi/linux'
cc -Wall -g -fpic -c -I../hidapi `pkg-config libusb-1.0 --cflags` hid.c -o hid.o
hid.c:44:21: fatal error: libudev.h: No such file or directory
 #include <libudev.h>
                     ^
compilation terminated.
Makefile-manual:40: recipe for target 'hid.o' failed
make: *** [hid.o] Error 1
make: Leaving directory '/home/atticakes/ykush/hidapi/linux'
cp: cannot stat ‘hidapi/linux/libhidapi-hidraw.so’: No such file or directory
make: Entering directory '/home/atticakes/ykush/hidapi/libusb'
cc -Wall -g -fpic -c -I../hidapi `pkg-config libusb-1.0 --cflags` hid.c -o hid.o
g++ -Wall -g -fpic -c -I../hidapi `pkg-config libusb-1.0 --cflags` ../hidtest/hidtest.cpp -o ../hidtest/hidtest.o
g++ -Wall -g hid.o ../hidtest/hidtest.o `pkg-config libusb-1.0 --libs` -lrt -lpthread -o hidtest-libusb
cc -Wall -g `pkg-config libusb-1.0 --libs` -lrt -lpthread -shared -fpic -Wl,-soname,libhidapi-libusb.so.0 hid.o -o libhidapi-libusb.so
make: Leaving directory '/home/atticakes/ykush/hidapi/libusb'
‘hidapi/libusb/libhidapi-libusb.so’ -> ‘ykushcmd/linux/libhidapi-libusb.so’
Configuring ykush app files...
Building ykush command...
g++ -L/home/atticakes/ykush/ykushcmd/linux -o bin/ykushcmd ykushcmd/objs/ykushcmd.o ykushcmd/objs/commandParser.o ykushcmd/objs/usbcom.o -lhidapi-libusb -lusb-1.0 -ludev
/usr/bin/ld: cannot find -ludev
collect2: error: ld returned 1 exit status
Makefile:9: recipe for target 'ykushcmd' failed
make: *** [ykushcmd] Error 1

I tried digging around, but the only answers I found were something relating to linking libusb?

I figured I'd ask here before sending a support inquiry into Yepkit's support team, in hopes of making a much easier to use Raspberry Pi directed list of instructions.

As added information I have made sure to run apt-get update and apt-get upgrade as well as making sure raspi-config is up to date.

0

1 Answer 1

1

You can install the missing header file (libudev.h) with the following command:

sudo apt-get install libudev-dev

In general, when compiling you need the source files which are often, as in this case, available in the matching -dev package.

2
  • I understand that I was missing a source file necessary to build the program, but was having trouble figuring out what I needed to apt-get install. How would someone who is very new to rasbian (such as myself) go about finding what dependency is missing?
    – Atticakes
    Apr 25, 2017 at 5:36
  • @Atticakes google search is my go to on Debian based systems. Though this question has some alternatives askubuntu.com/questions/34704/… Apr 25, 2017 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.