What's the difference between libusb.h and usb.h in ubuntu? Which one is better?

别等时光非礼了梦想. 提交于 2021-02-10 20:43:11

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!