libusb-sys icon indicating copy to clipboard operation
libusb-sys copied to clipboard

How to use it with rust-msvc?

Open Boscop opened this issue 8 years ago • 3 comments

How to use it with rust-msvc?

D:\data\tmp\libusb-rs>cargo run --example list_devices
   Compiling libusb-sys v0.2.3
   Compiling kernel32-sys v0.2.2
error: failed to run custom build command for `libusb-sys v0.2.3`
process didn't exit successfully: `D:\data\tmp\libusb-rs\target\debug\build\libu
sb-sys-49cf5f1d794041ca\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "MSVC ta
rget detected. If you are using the MSVC ABI rust build, please use the GNU ABI
build instead."', src\libcore\result.rs:906:4

Boscop avatar Nov 02 '17 23:11 Boscop

Is it possible to use these bindings with the dll? https://sourceforge.net/projects/libusb-win32/

Boscop avatar Nov 03 '17 01:11 Boscop

@Boscop You've probably seen my comments from this morning on the other issues related to this topic. I've only ever built with MSYS2 on Windows. I posted the steps that work for me in https://github.com/dcuddeback/libusb-sys/issues/4, and there's a PR for a new build strategy that should work with MSVC: https://github.com/dcuddeback/libusb-sys/pull/5. I could use help testing https://github.com/dcuddeback/libusb-sys/pull/5, so if you try it, I'd appreciate some feedback on whether or not it works for you.

dcuddeback avatar Nov 03 '17 16:11 dcuddeback

I'm trying to make this PR work with no luck on linking: https://github.com/dcuddeback/libusb-rs/issues/17

seems that the remaining missing symbol is because of some differences on the visual studio version used to compile libusb?

Geobert avatar Apr 25 '18 20:04 Geobert