Ubuntu WSL is listed in Clion toolchains but says "not found"

Viewed 1555

Unlike this question or this one, CLion seems to detect the WSL correctly:

WSL Detected

You can see that Ubuntu-20.04 is listed but still not found :

Not found

Versions :

  • Windows 10 : 1803
  • WSL : 1 (since windows 1803 does not support WSL 2)
  • WSL Distrib : Ubuntu 20.04 from Windows store
  • CLion : 2021.2.3

Has anyone ever faced this issue?

2 Answers

The issue seem to be, that clion can't find the cmake, C compiler, or C++ compiler of the WSL. My guess is that you haven't installed those yet.

You can install gcc with:

sudo apt install build-essential

This article explains how to build cmake:

Go to — https://cmake.org/files/ That shows all the list of the versions of cmake, I use cmake-3.15.0-rc1.tar.gz.

Open your terminal or bash and download it.

wget https://cmake.org/files/v3.15/cmake-3.15.0-rc1.tar.gz

After downloading, then untar.

tar -xvzf cmake-3.15.0-rc1.tar.gz
cd cmake-3.15.0-rc1/
./bootstrap
sudo make
sudo make install
cd /bin/
sudo cp cmake /usr/bin/

Now don’t forget we are currently in cmake-3.15.0-rc1/ just go back by entering cd ... that takes you up one directory back. Now copy the directory to /usr/bin/share

sudo cp -r cmake-3.15.0-rc1/ /usr/share/cmake-3.15
export CMAKE_ROOT=/usr/share/cmake-3.15

After you have done that, clion should be able to detect everything correctly.

I asked the CLion support and this if the answer (which fixed my problem)

Actually, the best way to solve this is to update Windows. If it's not possible, then in CLion go to Help | Find Action, type "Registry...", select it and in the opened list find and and disable the wsl.execute.with.wsl.exe option. It should help.

Related