【发布时间】:2016-10-27 19:23:07
【问题描述】:
我最近在 Windows 上使用 Cygwin 安装了 gcc 5.4.0,因为我想测试 g++ 的 C++14 标准特性。当我尝试编译时,出现以下错误:
$ g++-5.4.0 -std=c++14 test.cpp
-bash: g++-5.4.0: command not found
这是我在 test.cpp 中编写的代码:
#include <iostream>
int main()
{
auto lambda = [](auto x){ return x; };
std::cout << lambda("Hello generic lambda!\n");
return 0;
}
可能是什么问题?我还尝试在命令中将C++14 替换为C++11,但得到了同样的错误。
【问题讨论】:
-
错误是你的路径中没有
g++-5.4.0,并不是你的GCC副本不支持C++14。