【发布时间】:2018-04-13 02:59:28
【问题描述】:
在 Windows 10 上,安装了 msys2,它是 mingw 的一个变体,我安装了带有 gcc 工具链和所有标准工具(如 make)的 cmake。
g++的版本是6.2,make是4.2.1都在路径里。
当我使用 cmake 构建时:
cmake .
它尝试使用 nmake 和 cl 构建。所以不知何故因为我在 Windows 上 cmake 正在尝试使用 Visual Studio 工具链。
export CMAKE_CXX_COMPILER=g++
没有帮助。错误是:
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is Clang 3.8.0
-- Check for working C compiler: D:/msys64/mingw64/bin/clang++.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_87e5f\fast"
-- Check for working C compiler: D:/msys64/mingw64/bin/clang++.exe -- broken
CMake Error at D:/msys64/mingw64/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "D:/msys64/mingw64/bin/clang++.exe" is not able to compile a
simple test program.
It fails with the following output:
Change Dir: D:/git/CSP/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_87e5f\fast"
Generator: execution of make failed. Make command was: "nmake" "/NOLOGO"
"cmTC_87e5f\fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "D:/git/CSP/CMakeFiles/CMakeOutput.log".
See also "D:/git/CSP/CMakeFiles/CMakeError.log".
【问题讨论】: