I referenced from some web pages for developing usb enumeration function with libusb. I've installed libusb-1.0-dev on my linux, but the compiler told me that the usb_init() and usb_find_busses() are not declared in the libusb.h, which those introduced by several technical web sites or blogs.

Instead, I found libusb_init() and libusb_get_device_list() in the header file. So, are the API changed with the newer functions in the recently version of the library?


usb_init() and usb_find_busses are part of the older libusb 0.1 API, and shouldn’t be used any more. The libusb 1.0 API was released in 2008, so there’s been plenty of time for 1.0-based tutorials to be written; I recommend you look into that rather than trying to learn the 0.1 API.

See the libusb web site for details (the API documentation is unfortunately hosted on SourceForge, so it’s hard to access; but your distribution should have a documentation package containing all the API documentation).

  • I'm not able to find any appropriate documentation for this user case. – not2qubit Jan 18 at 14:19
  • @not2qubit which use case? If you’re trying to enumerate USB devices as in the original question, see libusb_get_device_list. – Stephen Kitt Jan 18 at 14:29
  • Yeah, I see what you say. I was just over eagerly hoping to find/see some example code using these and not only the API function type. – not2qubit Jan 31 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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