How to use WSL with CLion

Viewed 4524

I am attempting to set up CLion to use the Windows Subsystem for Linux, following the instructions at https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html#. Windows Version 10.0.18362.836. Ubuntu 20.04 LTS, all software current.

I am getting the following error reported on the Build, Execution, Deployment > Toolchains page of the Settings Dialog: Test CMake run finished with error more... Details...

CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:185 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- The C compiler identification is GNU 9.3.0
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:212 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- The CXX compiler identification is GNU 9.3.0
CMake Error at /usr/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake:210 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:80 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:73 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- Configuring incomplete, errors occurred!
See also "/mnt/c/Users/user/AppData/Local/Tmp/cmake_check_environment/_build2367382020510955708/CMakeFiles/CMakeOutput.log".
See also "/mnt/c/Users/user/AppData/Local/Tmp/cmake_check_environment/_build2367382020510955708/CMakeFiles/CMakeError.log".

Error code: 1

What do I do to fix this?

2 Answers

I've had the same problem using WSL 2 and Ubuntu 20.04.1.

Problem seemed to be that the Ubuntu WSL and the Windows Host machine had slightly unsynchronized processor clocks.

CMakeError.log:

make: Warning: File 'CMakeFiles/cmTC_823ef.dir/flags.make' has modification time 0.046 s in the future
make: warning:  Clock skew detected.  Your build may be incomplete.

A WSL restart with wsl --shutdown and wsl fixed the problem.

The solution to the problem could be found here.

at first step check you installed all dependencies

sudo apt-get install cmake gcc clang gdb build-essential

then you should configure ssh server on your ubuntu terminal if you can do it yourself great! you dont need to do anything else but if you cant use jet brains script

in toolchains section connect to your ssh session

but after reviewing this , i noticed that compiler gave you a log file in last bottom for futher information send it here , and try reinstall packages them, that should works fine just in most case and one question you are using wsl 1 or 2? wsl 2 has more features than 1 but it has so many bug and its not good for mot programmers and i dont suggest it to anybody

Related