-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't be build with msvc #17
Comments
I got it working on windows with a .cargo/config build script override and the dll from here: [target.x86_64-pc-windows-msvc.'usb-1.0']
rustc-link-search = ['D:\libs\64bit']
rustc-link-lib = ['libusb-1.0'] |
@bitbegin I only have experience building with MinGW on Windows. I don't recall whether MSVC was even an option for Rust at the time (that was nearly 3 years ago). Earlier this year, someone opened a PR for libusb-sys with a build strategy that he claims supports MSVC: dcuddeback/libusb-sys#5. I haven't had time to test it myself, and since I'm not as familiar with Windows as I am with Unix, I could use help testing it. If you get a chance to test dcuddeback/libusb-sys#5, I'd appreciate some feedback on whether or not it solves your issue. @Boscop Thanks for the work-around. |
I managed to test the PR and it works after doing:
To merge the PR I just edited |
I talk too fast,
|
From what I can gather, we may need |
As a test, I've put
|
Ok, I've done more tries and here are my results.
I'm not a linker specialist and I am quite lost now :-/ |
I'm dumb: while rebuilding libusb, I forgot to set it to x64… In conclusion, the PR works if we have the correct libusb binary :) |
@Geobert what arguments did you pass to cargo to get it use your libusb libraries? |
If I recall properly, I hacked into the .cargo folder to see if something can come out and I don't use libusb anymore so I didn't reach the phase to do a clean build with passing params to cargo. Sorry :( |
@Geobert did you switch to something else instead? I'm having a hell of a time getting it to compile for MIPS architecture. |
I'm using hidapi |
@Geobert sorry to necro you again. I've tried to rebuild libusb using my current build tools (2019) set to x64 but I still end up with the link errors in your earlier post (#17 (comment)) Did you do anything else after rebuilding for x64? |
As I said, I've done an ugly hack by tampering the files in .cargo but I can't remember what as I didn't use libusb in the end. Sorry :-/ |
I'm not building for mvc but I managed to get my build for android using the following. .cargo/config
Directory structure
Hopefully that helps someone. |
rust msvc environment can't use pkg-config-sys crate. Is there any solutions?
The text was updated successfully, but these errors were encountered: