如何获得合适的 C++ 来编译 CMAKE

How to get an appropriate C++ for compiling CMAKE

我在 Winodws7 64bit 上使用 MinGW64+msys

现在我正在尝试构建 CMAKE,但我做不到。

当我键入 ./configure 时,很快就发生了错误。 .

---------------------------------------------
CMake 3.2.3, Copyright 2000-2015 Kitware, Inc.
Found GNU toolchain
C compiler on this system is: gcc
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.

我还在 Bootstrap.cmk/cmake_bootstrap.log 中找到错误消息,如下所示。

[日志文件中的第一条消息]

In file included from c:/mingw64/x86_64-w64-mingw32/include/c++/iosfwd:40:0,^M
                 from c:/mingw64/x86_64-w64-mingw32/include/c++/ios:38,^M
                 from c:/mingw64/x86_64-w64-mingw32/include/c++/ostream:38,^M
                 from c:/mingw64/x86_64-w64-mingw32/include/c++/iostream:39,^M
                 from cmake_bootstrap_4468_test.cxx:3:^M
c:/mingw64/x86_64-w64-mingw32/include/c++/bits/postypes.h:40:35: fatal error: cw
char: No such file or directory^M
compilation terminated.^M

[日志文件中的第二条消息]

cmake_bootstrap_4468_test.cxx:5:23: fatal error: iostream.h: No such file or dir
ectory^M
compilation terminated.^M
Test failed to compile

他们说 cwchariostream.h 不存在,尽管我有它们并将它们的路径设置为环境变量。

第一条消息说我的C++编译器不合适。我通过 mingw-get.exe.

安装了它

有谁知道,我怎样才能获得合适的 C++ 编译器?

您混用了两个编译器。我建议:删除旧的并安装 .