ubuntu - 如何在 CLion 中使用 WSL
问题描述
我正在尝试按照https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html中的说明设置 CLion 以使用适用于 Linux 的 Windows 子系统# . Windows 版本 10.0.18362.836。Ubuntu 20.04 LTS,所有软件都是最新的。
我在设置对话框的构建、执行、部署 > 工具链页面上报告了以下错误:
Test CMake run finished with error more...
详细信息...
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
我该怎么做才能解决这个问题?
解决方案
我在使用 WSL 2 和 Ubuntu 20.04.1 时遇到了同样的问题。
问题似乎是 Ubuntu WSL 和 Windows 主机的处理器时钟稍微不同步。
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.
WSL 重新启动wsl --shutdown
并wsl
解决了该问题。
可以在此处找到问题的解决方案。
推荐阅读
- mysql - 按 200 行分组,从最新的 ID 开始
- spring-boot - 在高负载期间处理 Spring 上下文刷新
- linux - QEMU/KVM/libvirt macvtap VEPA 不工作 - ARP 请求不转发
- python - 用列中的值替换子字符串 - 第 2 部分
- firebase - 我应该使用什么事件来跟踪用户多久没有打开我的应用程序?
- php - 为什么 ORM 不给我发回对象?
- magento - 自定义模板未加载
- django - 如何正确管理 django 模型关系?
- xml - 如何从两个 XML 中获取所有 ID 并使用 XSL 合并到一个 XML
- java - 从基类调用但在派生类中未覆盖的方法中的 Java 继承和 this 关键字