Getting undefined reference to 'hid_get_report descriptor' and 'hid_get_device_info' when compiling/linking test.c #665

Closed
opened 2024-03-08 12:33:45 -06:00 by ajdalessio · 1 comment
ajdalessio commented 2024-03-08 12:33:45 -06:00 (Migrated from github.com)

Hi, I've installed hidapi-libusb (sudo apt install libhidapi-dev) and downloaded include file (hidapi.h) and test.c code. When compiling as follows:

gcc -o test.bin test.c -lhidapi-libusb

I get "undefined reference to 'hid_get_report descriptor'" and "undefined reference to 'hid_get_device_info' " errors.

I'm working on an Ubuntu 22.04.4 LTS system.

Which are the possible cause? Thanks for your help!

AD

Hi, I've installed hidapi-libusb (sudo apt install libhidapi-dev) and downloaded include file (hidapi.h) and test.c code. When compiling as follows: gcc -o test.bin test.c -lhidapi-libusb I get "undefined reference to 'hid_get_report descriptor'" and "undefined reference to 'hid_get_device_info' " errors. I'm working on an Ubuntu 22.04.4 LTS system. Which are the possible cause? Thanks for your help! AD
Youw commented 2024-03-08 14:25:38 -06:00 (Migrated from github.com)

The header you've downloaded is from a different version than the binary you've installed.
When you've installed the libhidapi-dev - the header is installed in the system as well - you should use that one.

The header you've downloaded is from a different version than the binary you've installed. When you've installed the libhidapi-dev - the header is installed in the system as well - you should use that one.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi#665
No description provided.