简体   繁体   English

在Windows 7上安装libusb-1.0

[英]Installing libusb-1.0 on Windows 7

It seems that the easiest way to install libusb-1.0.9 onto Windows 7 for use in Visual C++ is to use Cygwin or similar software to build and install it to my computer. 似乎将用于Visual C ++的 libusb-1.0.9安装到Windows 7上的最简单方法是使用Cygwin或类似的软件来构建并将其安装到我的计算机上。 Is there an easier way to do it that I have not found, or am I going about this all wrong? 是否有一种更简单的方法可以做到这一点,我还没有找到,或者我是否认为这一切都错了?

I would like to use libusb to communicate with an Arduino Due , and development will be done in Visual Studio (and maybe Dev-C++ ). 我想使用libusb与Arduino Due进行通信,开发将在Visual Studio(也许是Dev-C ++ )中完成。

You can use libusb-win32 for this. 你可以使用libusb-win32

To install libusb on Windows 7 download the bin package for libusb-win32 (this link points to version 1.2.6). 要在Windows 7上安装libusb,请下载libusb-win32的bin包 (此链接指向版本1.2.6)。 Then go to the bin directory and run inf-wizard.exe . 然后转到bin目录并运行inf-wizard.exe Here is where you can customize and generate an INF installation file for your device, as well as the installer executables. 您可以在此处为设备自定义和生成INF安装文件,以及安装程序可执行文件。 Select the same bin directory you are running from to place the output of the tool (so that the INF file is next to the x86 , amd64 and ia64 directories). 选择运行的相同bin目录以放置工具的输出(以便INF文件位于x86amd64ia64目录旁边)。

Now you can run the installation executable. 现在您可以运行安装可执行文件。 You can also go to Device Manager and right click your device and choose "Update Driver Software" and point directly at your generated INF file. 您也可以转到设备管理器并右键单击您的设备,然后选择“更新驱动程序软件”并直接指向生成的INF文件。

At this point your device should be loaded, so you should be able to communicate with it by including the lusb0_usb.h file in your project (located in the include directory) and linking your project to the appropriate LIB file in the lib directory. 此时应该加载您的设备,因此您应该能够通过在项目中包含lusb0_usb.h文件(位于include目录中)并将项目链接到lib目录中的相应LIB文件来与之通信。 The API can be found here . API可以在这里找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM