简体   繁体   中英

How to enable rust debugging when using WSL toolchain in CLion?

I am new to rust and I am using CLion and the rust plugin from JetBrains on Windows now. It works well when I just compile and run. But when I start debugging, it shows a dialog like this even though I switch my toolchain to WSL.

WSL工具链设置的屏幕截图

错误对话框的屏幕截图

I wonder whether WSL is a kind of GNU toolchain. And if it is, what should I do to enable rust debugging? Thanks.

Rust provides two kinds of Tier 1 toolchains for the Windows operating system: pc-windows-msvc and pc-windows-gnu (for i686 and x864_64 architectures, making 4 toolchains in total). Their differences are highlighted here: What are the differences between the GNU and MSVC Rust toolchain?

WSL requires you to use the GNU toolchain. With Rustup, you can install it and make it the default (or configure it in your IDE of choice):

rustup toolchain add stable-x86_64-pc-windows-gnu
rustup default stable-x86_64-pc-windows-gnu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM