



Create a file with the path /include/_mingw.h and the content shown below.Get your MinGW-w64 compiler installed somewhere.By providing such a file in your MinGW-w64 directory structure you can trick the compiler into accepting it as MinGW compiler. When I ran ProcMon and tracked what in the filesystem CLion accessed, I noticed that it checks for the existence of include/_mingw.h. As a MinGW user for many years, the fact that CLion only wanted to recognize the original MinGW as compiler seemed rather odd, since the differences in using either a MinGW or a MinGW-w64 version nearly doesn’t exist. As such CLion currently only officially supports the vanilla MinGW. Tricking CLionįor whatever reasons the developers at CLion apparently didn’t get the memo, that the original MinGW has been relatively abandoned and most of the user base has moved on to the MinGW-w64 project, which originally was created to develop a 64-bit compiler, but now supports both architectures. This post however shouldn’t really be about introducing/promoting CLion and maybe some or many of you who somehow find this post already know what CLion is, instead this should actually be a short tutorial on how to use a compiler of the MinGW-w64 family with CLion. However maybe Qt Creator upped their game since then as well. Last I checked out Qt Creator, I was a bit disappointed at the sluggish CMake integration this at least seems to work a lot better with CLion. Personally I haven’t really looked at the IDE in-depth, since JetBrains is the creator of the allegedly awesome ReSharper tool for Visual Studio – which I’ve never used – the IDE itself should provide some pretty decent refactoring capabilities. Some might recognize the interface since it’s very similar to JetBrains’ popular Java editor IntelliJ IDEA. CLion is a new IDE developed by JetBrains for CMake based projects, it supports multiple languages and can be further extended with plugins. In the past few days, I’ve seen CLion mentioned on multiple locations including the SFML forum. You can even delete/remove your windows rust install.Update : As pointed out by Anastasia Kazakova in the comments, CLion’s EAP has received an update which added native support for MinGW-w64! Now you can leave all your projects inside \\$wsl and use all the standard linux/GNU tools and libraries. You know it's working when you run something and the first cmd in the output window is something like `C:\Windows\system32\wsl.exe` The standard library path should auto-update if you've set the toolchain root correctly. It should be someplace like: \\wls$\Ubuntu\home\user-name\.cargo\bin`. Then just change up your rust toolchain location (setting->Languages & Frameworks->Rust) to point to your WSL toolchain. You need to install rust in wsl, like any Linux distro. These instructions are for CLion 2021.2.1, from this change-log : īasically, just turn on the experimental option `` (you can search actions for 'experimental features" to find the list of options). I'm adding this comment as this is the top search result in google when looking for "clion wsl rust". Using Windows CLion to work on linux/GNU rust projects under WSL now works (at least for me).
