C++ 如何在 Windows 上设置 cmake
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26514500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to setup cmake on windows
提问by anthony corrado
I'm trying to compile a program that requires Cmake and boost on windows. I installed visual studio 2013 express and I cant get cmake to compile the program.
我正在尝试编译一个需要在 Windows 上使用 Cmake 和 boost 的程序。我安装了visual studio 2013 express,但无法使用cmake来编译程序。
cmake -G "Visual Studio 11 Win64" ..
-- The C compiler identification is unknown
-- The CXX compiler identification is unknow
CMake Error in :
No CMAKE_C_COMPILER could be found.
CMake Error in :
No CMAKE_CXX_COMPILER could be found.
回答by drescherjm
Visual Studio 11 Win64is the wrong generator for Visual Studio 2013. You need to use Visual Studio 12 2013 Win64if you are using cmake-3.x or Visual Studio 12 Win64for cmake-2.8.x. A list of the visual studio generators is here.
Visual Studio 11 Win64是 Visual Studio 2013 的错误生成器。如果您使用 cmake-3.x 或Visual Studio 12 Win64for cmake-2.8.x,则需要使用Visual Studio 12 2013 Win64。Visual Studio 生成器的列表在这里。