WSL 上对 configure_file 的每次调用均失败:configure_file 配置文件时出现问题
Every call to configure_file fails on WSL: configure_file Problem configuring file
我刚刚在全新的 WSL 安装 (Ubuntu18.04 LTS) 上构建并安装了 cmake 3.16。然后我创建了一个默认的 hello world 项目
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest$ tree .
.
├── CMakeLists.txt
└── main.cpp
//CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(ATest)
set(CMAKE_CXX_STANDARD 14)
add_executable(ATest main.cpp)
//main.cpp
#include <iostream>
#include <string>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
然后尝试构建:
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest$ mkdir build
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest$ cd build/
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest/build$ cmake ..
我得到以下信息。
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:185 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The C compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:212 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The CXX compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake:210 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (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/local/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:80 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (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/local/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:73 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/mnt/d/ATest/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/d/ATest/build/CMakeFiles/CMakeError.log".
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest/build$
我本来试的是cmake 3.15,后来升级了看是不是版本问题,我觉得不是。我也试过 g++-7
和 g++-9
它们的行为相同。
有人知道这里会发生什么吗?谢谢。
- 在 /etc/ 中创建一个名为
wsl.conf
的文件,其中包含以下文本:
# /etc/wsl.conf
[automount]
options = "metadata"
enabled = true
- 重新启动 wsl:
wsl.exe -t Ubuntu // (or other e.g. Debian)
来源:
我刚刚在全新的 WSL 安装 (Ubuntu18.04 LTS) 上构建并安装了 cmake 3.16。然后我创建了一个默认的 hello world 项目
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest$ tree .
.
├── CMakeLists.txt
└── main.cpp
//CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(ATest)
set(CMAKE_CXX_STANDARD 14)
add_executable(ATest main.cpp)
//main.cpp
#include <iostream>
#include <string>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
然后尝试构建:
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest$ mkdir build
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest$ cd build/
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest/build$ cmake ..
我得到以下信息。
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineSystem.cmake:185 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The C compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCCompiler.cmake:212 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- The CXX compiler identification is GNU 10.1.0
CMake Error at /usr/local/share/cmake-3.16/Modules/CMakeDetermineCXXCompiler.cmake:210 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (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/local/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:80 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (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/local/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:73 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/mnt/d/ATest/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/d/ATest/build/CMakeFiles/CMakeError.log".
(base) ciaran@DESKTOP-K0APGUV:/mnt/d/ATest/build$
我本来试的是cmake 3.15,后来升级了看是不是版本问题,我觉得不是。我也试过 g++-7
和 g++-9
它们的行为相同。
有人知道这里会发生什么吗?谢谢。
- 在 /etc/ 中创建一个名为
wsl.conf
的文件,其中包含以下文本:
# /etc/wsl.conf
[automount]
options = "metadata"
enabled = true
- 重新启动 wsl:
wsl.exe -t Ubuntu // (or other e.g. Debian)
来源: