【问题标题】:CMake Error: configure_file Problem Configuring File - with CLionCMake 错误:configure_file 配置文件问题 - 使用 CLion
【发布时间】:2020-05-31 06:20:29
【问题描述】:

我正在尝试使用 WSL 在 Windows 上设置我的 CLion,遵循官方教程:https://www.jetbrains.com/help/clion/how-to-use-wsl-development-environment-in-clion.html

在设置工具链时,现在在编辑器中,在识别 C 编译器和功能、C++ 编译器和功能后,我遇到了同样的错误。导致错误的行总是相同的:

configure_file(
  ${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
  ${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake
  @ONLY
)

我正在使用带有 Ubuntu 20.04、GCC 和 G++ 版本 9.3.0 的 Linux 2 的 Windows 子系统。

请帮我诊断问题。

【问题讨论】:

  • 如果可能,请以文本形式提供您的错误消息。如果错误已经以文本形式呈现,您可以使用图片来补充您的帖子。

标签: gcc cmake g++ clion


【解决方案1】:

我遇到了同样的问题。

我在这里找到了解决方案:https://intellij-support.jetbrains.com/hc/en-us/community/posts/360003413779-Troubles-with-WSL-toolchain-Test-CMake-run-finished-with-errors-

总而言之,您应该创建一个 wsl 配置文件 /etc/wsl.conf 并添加以下行:

[automount]
options = "metadata"
enabled = true

在此之后,您应该重新启动您的 wsl(在 powershell 中)。

wsl.exe -l     // gets a list of your linux distributions
wsl.exe -t *name-of-your-distribution*

【讨论】:

    猜你喜欢
    • 2018-06-07
    • 2015-03-30
    • 1970-01-01
    • 1970-01-01
    • 2015-12-01
    • 1970-01-01
    • 2016-12-14
    • 2017-06-06
    • 2021-03-16
    相关资源
    最近更新 更多