Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSVC toolchain is not supported. Please use GNU toolchain

Tags:

rust

clion

I was trying to debug Rust in CLion when I was greeted with the aforementioned

enter image description here

I updated my toolchain setting to use the suggested default as such:

enter image description here

How can I fix this issue and get CLion to be able to debug Rust code?

I did some searching but haven't found a simple answer (at at least one I can understand easily).

Any help would be greatly appreciated.

like image 523
Jonathan Woollett-light Avatar asked Aug 21 '19 03:08

Jonathan Woollett-light


2 Answers

Error message is related about Rust toolchain, you need to use GNU based toolchain for Rust.

If you haven't installed it yet, please make sure that you are choosing the valid gnu based toolchain for your environment, if you are not sure please read the Note section. You can install it via:

> rustup toolchain install stable-x86_64-pc-windows-gnu

Then the easiest way to solve this problem is setting this toolchain as the default Rust Toolchain:

> rustup default stable-x86_64-pc-windows-gnu

Note : Toolchain stable-x86_64-pc-windows is selected as an example; it's a solution for 64-bit Windows via stable channel, another toolchain needs to be used for different architecture(Details: please follow the official jetbrains guide from other answer), also you are free to use nightly or beta.

like image 127
Ömer Erden Avatar answered Nov 10 '22 12:11

Ömer Erden


As well as Ömer Erden's answer it is worth pointing out that Jetbarins now has an article about how to configure Clion for Rust complete with some tips on what settings are applicable to Rust development.

Debugging Rust Code in CLion

Particularly this paragraph is relevant to the question:

On Windows, go to Settings | Build, Execution, Deployment | Toolchain and set either Cygwin or MinGW as your working environment. Then, run rustup toolchain list and check the first line: it should be one of the gnu versions matching the bitness of the debugger. For example, if you’re working on MinGW (32-bit), the default toolchain should be i686-pc-windows-gnu. If you’re on MinGW64, it should be x86_64-pc-windows-gnu. You can set the appropriate toolchain by running rustup default <toolchain_name>.

like image 42
user3797758 Avatar answered Nov 10 '22 12:11

user3797758