开发者

Is there an alternative to libusb-win32 for 64bit windows?

开发者 https://www.devze.com 2022-12-25 23:27 出处:网络
I\'ve been developing some software which uses the libusb-win32 library to interact with some USB hardware I\'ve been developing. Now I\'m trying to run the same software on windows 64 but 开发者_开发

I've been developing some software which uses the libusb-win32 library to interact with some USB hardware I've been developing. Now I'm trying to run the same software on windows 64 but 开发者_开发知识库the drivers don't seem to work (understandably).

Are there any alternatives for 64 bit Windows I've overlooked?


Looks like there may be some 64-bit pre-compiled version available here and here.

[Edit] Oops. Looks like this is already provided for in libusb-win32 in the latest release. 64bit and 32bit are both provided in the device driver package.


The last version 1.2.6.0 does not work in Windows 10, and presumably not in Windows 8/8.1. Works fine in 32/64 bit Windows 7. Development appears to have stopped in 2013.


Was having the similar issues with windows builds in Go.

As I did not find this easy to figure out I will be a little verbose here to ensure what works for me is clear for the novice that stumbles across this post.

Windows 10 X64

  • Install msys2
  • install either 32 bit pacman -S mingw-w64-i686-toolchain or 64 bit pacman -Sy mingw-w64-x86_64-toolchain
  • check version of libusb that installed pacman -Q | grep libusb

    mingw-w64-x86_64-libusb 1.0.23-1

  • create /mingw64/lib/pkgconfig/libusb-1.0.pc
#lib-usb-1.0.pc
prefix=/mingw64
exec_prefix=${prefix}
libdir=${exec_prefix}/x86_64-w64-mingw32/lib
includedir=${prefix}/include

Name: libusb-1.0
Description: C API for USB device access from Linux, Mac OS X, Windows, OpenBSD/NetBSD and Solaris userspace

#update version to match
Version: 1.0.23
Libs: -L${libdir} -llibusb-1.0
Libs.private: 
Cflags: -I${includedir}/libusb-1.0
  • create directory /mingw64/include/libusb-1.0
  • download correct version of libusb.h and extract to /mingw64/include/libusb-1.0/libusb.h
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号