WSL wrong cmake path created


Hey  Jetbrains-Community,

I have a problem when creating Cmake Projects in WSL on Windows 11:

Cannot create directory \\wsl$\Ubuntu-20.04\wsl$\Ubuntu\home\pg\Git\rocket\code\arduino\cmake-build-debug

As you can see from the path he goes in another WSL (Ubuntu-20.04) first and then tries to access the right WSL Ubuntu. I can not find anything where I might have set this path and can resolve this. The WSL Ubuntu is running on WSL 1 because of not working access to serial COM devices in WSL 2 needed for embedded development.

Interestingly the folder does get created with only a clion-log.txt with the error message.

I cant exactly tell you how to recreate this issue. I only create a new cmake project in the users directory in clion and when it loads it does not work. Here are some facts about my setup:
Windows 11 Pro Version 10.0.22000 Build 22000
Build #CL-213.6461.75, built on December 28, 2021 installed via winget
Ubuntu-20.04 WSL 2
Ubuntu WSL 1

Looking at the logs of clion and the WSL I could not find anything interesting.

If you have an idea on how to solve this please answer or if you need more information do not hesitate to ask!

Comment actions Permalink


To begin with, please provide the following details:

  1. A screenshot of `File | Settings | Build, Execution, Deployment | Toolchains` (please capture the screenshot after the compiler detection is completed).
  2. Do `Tools | CMake | Reset Cache and Reload Project` and provide the entire output from the CMake tool window.
  3. What location do you specify when create a new project?
Comment actions Permalink

That's embarrassing, when I took to screenshot that the wrong WSL was selected in the toolchain. I looked at this a dozens of times and did not see it. Sorry for wasting your time!

Comment actions Permalink

I'm glad you solved the issue!

Comment actions Permalink

I reported the same error, here is a screenshot of my toolchains
error is:

can you help me?

Comment actions Permalink

914384274 please close the project (File | Close Project) and create a default "Hello, World!" project (on Welcome Screens select New Project > C++ Executable > Create). Does the issue happen in this project?


Please sign in to leave a comment.