问题
I'm a newbie in libusb c programming. Should I know the difference between libusb.h and usb.h? I have installed both of them in Ubuntu(xenial) with package libusb-1.0-0-dev and libusb-dev. Which one is better? Are they from the same origin libusb.info?
Thanks,
回答1:
The libusb library has onetime switched from version 0.1 to version 1.0, breaking compatibility.
usb.h
- is a header for libusb 0.1, the older one.
libusb.h
- is a header for libusb 1.0, the newer one.
Correspondingly, libusb-dev is based on version 0.1 and provides the former header. libusb-1.0-0-dev is based on version 1.0 and provides the latter header.
You should choose the one depending on your needs, but generally for new development you should choose the newer one, libusb-1.0 and libusb.h
header.
Also, there is the libusb-compat-0.1 library, which provides the compatibility layer for binaries written for libusb-0.1 to be run in environment with libusb-1.0. The libusb-compat-0.1 also provides the usb.h
header.
来源:https://stackoverflow.com/questions/47442638/whats-the-difference-between-libusb-h-and-usb-h-in-ubuntu-which-one-is-better