I used vscode+wsl+rust-analyzer to write a program that requires windows clipboard, for cross-platform syntax checking, setting rust-analyzer.cargo.target
to x86_64-pc-windows-gnu
worked, but when I tried to use Run | Debug
to debug my program, the target
parameter doesn't seem to take effect. Here is the error message in the terminal.
> Executing task: cargo run --package clipboard-sync-client --bin clipboard-sync-client <
Compiling clipboard-sync-client v0.1.0 (/home/wsl_halc/repo/clipboard-sync-rs/clipboard-sync-client)
error[E0432]: unresolved imports `clipboard_win::formats`, `clipboard_win::Clipboard`, `clipboard_win::Getter`, `clipboard_win::Setter`, `clipboard_win::SysResult`
--> clipboard-sync-client/src/main.rs:8:21
|
8 | use clipboard_win::{formats, Clipboard, Getter, Setter, SysResult};
| ^^^^^^^ ^^^^^^^^^ ^^^^^^ ^^^^^^ ^^^^^^^^^ no `SysResult` in the root
| | | | |
| | | | no `Setter` in the root
| | | no `Getter` in the root
| | no `Clipboard` in the root
| no `formats` in the root
For more information about this error, try `rustc --explain E0432`.
error: could not compile `clipboard-sync-client` due to previous error
The terminal process "cargo 'run', '--package', 'clipboard-sync-client', '--bin', 'clipboard-sync-client'" terminated with exit code: 101.
By the way, I have no problems with cargo build --target x86_64-pc-windows-gnu
, so I think the problem is with rust-analyzer, but I'm not quite sure how to use it correctly