Getting undefined reference to 'hid_get_report descriptor' and 'hid_get_device_info' when compiling/linking test.c #665
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi#665
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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.