CLion issue on WSL cross compiling for Linux on Windows OS


I am getting the following error while compiling for Ubuntu with WSL.

How can get rid of it?

I have read some posts but it is not completely clear what could be the issue. I tried to follow the topic about case sensitive of IntelliJ and not case sensitive Windows but i did not fix my issue.

I have read some other stuff but what is the real thing to do to fix my problem and let me compile also for Linux while running on Windows OS.


C:\WINDOWS\system32\wsl.exe --distribution Ubuntu --exec /bin/sh -c "export CLION_IDE=TRUE && export JETBRAINS_IDE=TRUE && cd '/mnt/w/VMyyyy_xxx - AnC CW/VMyyyy_xxx - Line (OCxxxx bla blabla)/' && /usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G 'CodeBlocks - Unix Makefiles' '/mnt/w/VMyyyy_xxx - AnC CW/VMyyyy_xxx - Line (OCxxxx bla blabla)/'; exitcode=$?; sleep 0.001; (exit $exitcode)"
/bin/sh: 1: cd: can't cd to /mnt/w/VMyyyy_xxx - AnC CW/VMyyyy_xxx - Line (OCxxxx bla blabla)/
评论操作 固定链接


It seems there is a problem to change working directory (on W drive).

Please do the following:

  1. In Terminal run wsl -d Ubuntu
  2. and then run cd /mnt/w/<path_to_project>/cmake-build-debug-wsl && ls

What result do you get?

评论操作 固定链接

while writing to you i got the same idea and i copied from remote folder (which was W letter drive) to the local C drive and it worked.

Actually the folder /mnt/w does not exist at all. I was thinking that CLion should automatically generate it but seems it does not.

评论操作 固定链接

After other couple of test I can say that there might be 2 problems:

  1. Everything works only using C drive. if you open the project from a remote like drive W that is mapped on \\myserver\myfolder does not work.

  2. Issue on permissions even if folder created correctly and assigned as permission 777.