Windows中Make的行为与Linux不同,如何编译简单的C++;11在Windows上使用Make的代码? 我开始学习C++,以前用Linux编写的。现在我尝试在安装了Codeblocks GCC包的Windows中使用VS Code,并将适当的路径添加到path变量中。我正在使用一个C++11特性Foreach,我需要在编译器调用中指定它。我想运行生成代码,并使用所使用的标准对其进行充分编译。我在Linux中有这个功能,但在Windows中的表现不同

Windows中Make的行为与Linux不同,如何编译简单的C++;11在Windows上使用Make的代码? 我开始学习C++,以前用Linux编写的。现在我尝试在安装了Codeblocks GCC包的Windows中使用VS Code,并将适当的路径添加到path变量中。我正在使用一个C++11特性Foreach,我需要在编译器调用中指定它。我想运行生成代码,并使用所使用的标准对其进行充分编译。我在Linux中有这个功能,但在Windows中的表现不同,c++11,gcc,visual-studio-code,makefile,codeblocks,C++11,Gcc,Visual Studio Code,Makefile,Codeblocks,代码.cpp #include <iostream> int main(void) { using namespace std; for (short i : {1, 2, 3, 4, 5, 6, 7, 8, 9}) { cout << i << endl; } } 我在Linux上运行的Windows上执行此操作: $make code $Error: can't read makefile 'makef

代码.cpp

#include <iostream>
int main(void)  {
    using namespace std;
    for (short i : {1, 2, 3, 4, 5, 6, 7, 8, 9})
    {
        cout << i << endl;
    }

}
我在Linux上运行的Windows上执行此操作:

$make code
$Error: can't read makefile 'makefile'

您使用的是什么版本的GCC?在构建时,您为
g++
指定了哪些标志?显示您的
makefile
。你会犯什么错误?行为不同是什么意思?如果您不陈述问题并提出问题,我们将无法作出回应。更新信息,Ty获取help@CarlosCheco:请检查一下,您在Linux上也没有makefile?您只需在那里使用默认的
make
规则?您使用的是什么版本的GCC?在构建时,您为
g++
指定了哪些标志?显示您的
makefile
。你会犯什么错误?行为不同是什么意思?如果您不陈述问题并提出问题,我们将无法作出回应。更新信息,Ty获取help@CarlosCheco:请检查一下,您在Linux上也没有makefile?你只是在那里使用默认的
make
规则?
$make code
$Error: can't read makefile 'makefile'