Posts: 11
Joined: Fri May 25, 2012 4:53 pm
Location: Coventry, UK

Problem compiling LIBHID

Fri Nov 02, 2012 11:11 pm

Hi all.
I'm trying to get DCLED working, which is a small USB connected LED display - https://github.com/kost/dcled
This chap did it - http://through-the-interface.typepad.co ... art-4.html
but the instructions are incomplete for those without all the right dependencies.

I've compiled the dcled stuff just fine, but I've just had so much trouble trying to get one of it's dependencies, LibHid compiled and working it's borderline ridiculous.
LibHid isn't available as an apt-get thing, so I got hold of the sources from libhid.alioth.debian.org.
I'm using a recent (october I think) image of Raspbian from this very site.
Upon compilation I came across a lot of dependency issues, and made sure I have LibUsb and LibUsb-Dev along with it of various versions.
./configure seemed to work without issue, but this is what I see during make -
root@raspberrypi:~/kost-dcled-c819fec/libhid-0.2.16# make
make all-recursive
make[1]: Entering directory `/root/kost-dcled-c819fec/libhid-0.2.16'
Making all in hidparser
make[2]: Entering directory `/root/kost-dcled-c819fec/libhid-0.2.16/hidparser'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/kost-dcled-c819fec/libhid-0.2.16/hidparser'
Making all in src
make[2]: Entering directory `/root/kost-dcled-c819fec/libhid-0.2.16/src'
make[2]: Leaving directory `/root/kost-dcled-c819fec/libhid-0.2.16/src'
Making all in test
make[2]: Entering directory `/root/kost-dcled-c819fec/libhid-0.2.16/test'
make[3]: Entering directory `/root/kost-dcled-c819fec/libhid-0.2.16/src'
make[3]: Leaving directory `/root/kost-dcled-c819fec/libhid-0.2.16/src'
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -DNDEBUG -I../include -I../hidparser -O2 -Wall -W -Werror -MT lshid.o -MD -MP -MF ".deps/lshid.Tpo" -c -o lshid.o lshid.c; \
then mv -f ".deps/lshid.Tpo" ".deps/lshid.Po"; else rm -f ".deps/lshid.Tpo"; exit 1; fi
lshid.c: In function âdevice_iteratorâ:
lshid.c:32:87: error: parameter âlenâ set but not used [-Werror=unused-but-set-parameter]
cc1: all warnings being treated as errors
make[2]: *** [lshid.o] Error 1
make[2]: Leaving directory `/root/kost-dcled-c819fec/libhid-0.2.16/test'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/kost-dcled-c819fec/libhid-0.2.16'
make: *** [all] Error 2
Can anybody help out please, this isn't my area of expertise?


Posts: 11
Joined: Fri May 25, 2012 4:53 pm
Location: Coventry, UK

Re: Problem compiling LIBHID

Sat Nov 03, 2012 10:46 pm

Can anyone offer any help?

Posts: 1
Joined: Mon Nov 05, 2012 1:03 pm

Re: Problem compiling LIBHID

Mon Nov 05, 2012 1:22 pm


I just tried it myself and got the same error. To get the entire project to build completely you can edit lshid.c.

First, comment out (or just delete) line 41:
//len = *((unsigned long*)custom);

Then add the following two lines:
len = len;
custom = custom;

That "error" is caused by the fact that the "-Werror" compiler flag is set and the compiler sees the variable 'len' being set but never used (usually just a warning, but elevated by the flag). If you just delete or comment out line 41 the compiler will complain that both 'len' and 'custom' are not used. Again, these would be just warnings, but the compiler is told to elevate all warnings to errors.

The thing is, the error is occurring in a test program so you might even be able to run 'make install' without the test program building completely.

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 29 guests