C++ CMake不生成MinGW makefile,但生成MSVS 2013
我正在尝试从以下位置使用MinGW安装构建简单的控制台应用程序:。该软件包已经包含GCC 4.9.2和Boost 1.57。创建这样的简单文件:C++ CMake不生成MinGW makefile,但生成MSVS 2013,c++,cmake,mingw-w64,C++,Cmake,Mingw W64,我正在尝试从以下位置使用MinGW安装构建简单的控制台应用程序:。该软件包已经包含GCC 4.9.2和Boost 1.57。创建这样的简单文件: #include <iostream> #include <boost/accumulators/accumulators.hpp> using namespace std; int main() { cout << "Hello World!" << endl; return 0;
#include <iostream>
#include <boost/accumulators/accumulators.hpp>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
毕竟,对于这个应用程序构建,我只有MSVS项目/解决方案(我还安装了2013版)。但是我想使用MinGW安装来构建它
如何实现
UPD:cmake-G“MinGW生成文件”。-这是正确的命令行。
我在执行它时发现了一个注意事项-我的路径中有sh.exe
-一个在MSYS
目录中,一个在Git
目录中。它影响了MinGW构建,所以我将其重命名为sosh1.exe
这两个版本都很好
生成器选项为大写:-G
@Angew生成器选项为大写:
-G
@Angew噢,谢谢!真可耻!你要么删除问题,要么回答你自己的问题。
> pwd
/d/..../Boost-Accumulators
> mkdir build
> cd build
> pwd
/d/..../Boost-Accumulators/build
> cmake -g "MinGW Makefiles" ..
-- Building for: Visual Studio 12 2013
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler using: Visual Studio 12 2013
-- Check for working C compiler using: Visual Studio 12 2013 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 12 2013
-- Check for working CXX compiler using: Visual Studio 12 2013 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/alp/Projects/Boost-Accumulators/build