Installing libusb-1.0 on Windows 7

user3055073 picture user3055073 · Dec 1, 2013 · Viewed 24.7k times · Source

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. 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++).

Answer

Preston picture Preston · Dec 3, 2013

You can use libusb-win32 for this.

To install libusb on Windows 7 download the bin package for libusb-win32 (this link points to version 1.2.6). Then go to the bin directory and run inf-wizard.exe. Here is where you can customize and generate an INF installation file for your device, as well as the installer executables. 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).

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.

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. The API can be found here.