[libhid-discuss] Unable to compile test_libhid.c (Ubuntu x64)

Pontorez pontorez at pontorez.com
Fri Jun 4 19:21:14 UTC 2010


Hello All,

I have Ubuntu 10.04 (x86_64) and packages libhid0 and libhid-dev
(0.2.15+20060325-2.2ubuntu1) installed.
I'm new to libhid so the first thing I want to do is to compile some
hello world application.
There is some test file in libhid-dev package:
/usr/share/doc/libhid-dev/examples/test_libhid.c.gz
but it's impossible to compile it. Could you help please?

fluke at linux-x64:~/HID$ gcc -Wall -o result ./test_libhid2.c
/tmp/ccEzOq2V.o: In function `match_serial_number':
test_libhid2.c:(.text+0x31): undefined reference to `usb_device'
test_libhid2.c:(.text+0x50): undefined reference to `usb_get_string_simple'
/tmp/ccEzOq2V.o: In function `main':
test_libhid2.c:(.text+0xbc): undefined reference to `hid_set_debug'
test_libhid2.c:(.text+0xcb): undefined reference to `hid_set_debug_stream'
test_libhid2.c:(.text+0xd5): undefined reference to `hid_set_usb_debug'
test_libhid2.c:(.text+0xdf): undefined reference to `hid_init'
test_libhid2.c:(.text+0x11b): undefined reference to `hid_new_HIDInterface'
test_libhid2.c:(.text+0x170): undefined reference to `hid_force_open'
test_libhid2.c:(.text+0x1b8): undefined reference to `hid_write_identification'
test_libhid2.c:(.text+0x200): undefined reference to `hid_dump_tree'
test_libhid2.c:(.text+0x23e): undefined reference to `hid_close'
test_libhid2.c:(.text+0x279): undefined reference to `hid_delete_HIDInterface'
test_libhid2.c:(.text+0x283): undefined reference to `hid_cleanup'
collect2: ld returned 1 exit status
fluke at linux-x64:~/HID$

Just in case, the file I want to compile: http://pastebin.ca/1877430

Thanks



More information about the libhid-discuss mailing list