WSL path does not exist
Answered
Hi, I'm using CLion to work with WSL.
When I tried to run cmake, I got error
/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" //wsl$/Debian/home/jiachen/program/QMate
bash: line 0: cd: //wsl$/Debian/home/jiachen/program/QMate/cmake-build-debug: Permission denied
CMake Error: The source directory "//wsl$/Debian/home/jiachen/program/QMate" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
I think the //wsl$/Debian in the path causes this problem. Could anyone advise me how to tell CLion to use path like /home/MYPROJECT without //wsl$/Debian part? Thanks!
Please sign in to leave a comment.
Hello!
Hi Anna!
1. The Toolchains are shown in this picture
I opened project by Open or Import > \\wsl$\Debian\ > my project.
2. I did as you said and got same error, the testing project is located at \\wsl$\Debian\home\jiachen\program\hello
/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" //wsl$/Debian/home/jiachen/program/helloworld
bash: line 0: cd: //wsl$/Debian/home/jiachen/program/helloworld/cmake-build-debug: Permission denied
CMake Error: The source directory "//wsl$/Debian/home/jiachen/program/helloworld" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
And when I click Build, it showed that "Cannot find any CMake profile". I guess it's because the //wsl$/Debian part is the path.
Thank you for your help!
@... the preferred solution is to put your project on some local drive, for example,
C:\and open the project in CLion using this local path.If you would like to insist on using
\\wsl$\Debian\, you need to disable thewsl.prefer.p9.supportoption in Registry (Help | Find Action, type "Registry...", select it). But it will have a detrimental effect on performance.Anna Falevskaya Hi Anna, thanks for your reply!
1. Putting on local drive successfully found the WSL toolchains. However, cmake failed to find some libraries linked to my project by using find_path or find_library. I guess it's still the \\wsl$\Debian\ problem, am I right?
2. Putting on \\wsl$\Debian\. Actually the compiler is correctly found by enable wsl.prefer.p9.support, but same, libraries linked to my project still can not be found.
Could you please advise me a solution to it?
Have you tried to put you project for example on `C:\my_project` then goto wsl terminal to `/mnt/c/my_project` and then build the project manually (without CLion)?
Does it work?