Access to "std::os::windows" on linux Dev machine ?!

Hello,

I would like to know if it is possible to use std::os::windows but on a linux dev machine, I want to create a DLL for windows but the development is done on a linux machine.

I generate the DLL with this compilation command :
cargo build --release --target x86_64-pc-windows-gnu

but on Codium (VScode) , rust-analyzer doesn't give me access to std::os::windows:xxxx.

the only choice I have is this:
Screenshot from 2023-12-19 20-59-21

Do I need to code on Windows to access "std windows"?

You can set the target in the rust analyzer settings within VSCode.

1 Like

Thank you for this solution :pray:

I added this line to the "settings.json" :

 "rust-analyzer.cargo.target": "x86_64-pc-windows-gnu",

It works, but I have to change it each time if I want to switch between compiling for linux or for windows, is that correct?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.