ubuntu 中的 libusb.h 和 usb.h 有什么区别?哪一个更好? [英] What's the difference between libusb.h and usb.h in ubuntu? Which one is better?

查看:47
本文介绍了ubuntu 中的 libusb.h 和 usb.h 有什么区别?哪一个更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 libusb c 编程的新手.我应该知道 libusb.h 和 usb.h 之间的区别吗?我已经使用 libusb-1.0-0-dev 和 libusb-dev 在 Ubuntu(xenial) 中安装了它们.哪一个更好?它们是否来自同一来源的 libusb.info?

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?

谢谢,

推荐答案

libusb 库曾经一度从 0.1 版切换到 1.0 版,破坏了兼容性.

The libusb library has onetime switched from version 0.1 to version 1.0, breaking compatibility.

usb.h - 是 libusb 0.1 的头文件,旧版本.

usb.h - is a header for libusb 0.1, the older one.

libusb.h - 是 libusb 1.0 的头文件,较新的版本.

libusb.h - is a header for libusb 1.0, the newer one.

相应地,libusb-dev 基于 0.1 版本,并提供了前者的头文件.libusb-1.0-0-dev 基于 1.0 版本,提供了后者的头文件.

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.

你应该根据你的需要选择一个,但通常对于新开发你应该选择较新的一个,libusb-1.0 和 libusb.h 头.

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.

此外,还有 libusb-compat-0.1 库,它为为 libusb-0.1 编写的二进制文件提供了兼容层,以便在 libusb-1.0 的环境中运行.libusb-compat-0.1 还提供了 usb.h 标头.

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.

这篇关于ubuntu 中的 libusb.h 和 usb.h 有什么区别?哪一个更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆