以下简单程序无法使用gcc
在cygwin中编译#include <string>
#include <iostream>
int main()
{
std::cout << std::to_string(4) << std::endl;
return 0;
}
命令行:
$ g++ -std=c++0x to_string.cc
错误:
to_string.cc: In function ‘int main()’:
to_string.cc:6:16: error: ‘to_string’ is not a member of ‘std’
std::cout << std::to_string(4) << std::endl;
G ++版:
$ g++ --version
g++ (GCC) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
可以在Ubuntu中编译相同的代码。
是否可以使用cygwin编译此代码,或者我需要编写一个解决方法?
答案 0 :(得分:-1)