Using WSL Toolchains In Jetbrains CLion On Windows

Shehu Awwal
Shehu Awwal
Published in
2 min readApr 11, 2020

I have been looking at the best way for me to write C program on Windows, I don’t like writing C with Vscode and other got tired writing with vim, So I take a look at the Jetbrains Clion which offers some features like ability to integrate Windows Subsystem Linux with Clion, and using any compiler of your choice.

Starting SSH On Your WSL And Installing Cmake

First of all before we start with any process, go to your bash and start ssh.

service ssh start

You might have installed cmake, And the cmake might likely be the newer version, Clion has some version it works with, I think from 2.17 or so to 3.15.

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

That’s all,

By default gcc should be installed, unless you want to use clang, and also you will need to install gdb incase you haven’t done that.

sudo apt-get install clang
sudo apt-get install build-essential

Linking Clion With WSL

We have already done most of the settings, Now Open Clion and go to file > settings > Build, Execution, Deployment, > Tools Chain Click On Settings Icon In Credential And Input The Credentials.

Everything should be detected since we have already done it, over there.

As you can see, If you have any issue, kindly let me know and also take a look at this video by Jetbrains incase.

Using WSL ToolsChains In Clion On Windows

--

--

Shehu Awwal
Shehu Awwal

Hacker — Passionate About InfoSec, Linux, Clouds, Containers, Virtualization, Distributed Systems And Architectures And New Trends.