shjeff
shjeff

Reputation: 445

Compile libusb library on Windows

I am writing C++ application which will be using libusb library. This application will be working on both linux and windows systems. Currently I am preparing application for windows system. I downloaded compiled libusb library, and I am linking it to my application. I am also using mingw compilers. Unfortunately while linker creates exe file it complains about missing __ms_vsnprintf functions. I think the libusb library I am linking was compiled in environment which was using missing functions. So I think building new libusb library on windows will solve that problem. In libusb repository (git://git.libusb.org/libusb.git) I found in file INSTALL_WIN, that I can build libusb using Visual Studio or Windows DDK/WDK. Unfortunately I can't install it. I also noticed, in root libusb directory there are some build linux scripts. Is there some other way to build libusb library without Visual Studio but only with mingw compilers? Note: I am using Windows 7 64 bit

Upvotes: 2

Views: 4499

Answers (1)

Frederik Carlier
Frederik Carlier

Reputation: 4776

libusb ships with a Visual Studio project you can use to build libusb on Windows. They are located in the msvc folder, an example is libusb_dll_2017.vcxproj.

Easier still, libusb has also been integrated in vcpkg, so you can just run vcpkg install libusb to get started.

Upvotes: 2

Related Questions