我在 Cygwin 上安装了 Clang 并尝试编译此代码:
#include <iostream>
int main() {
std::cout << "hello world!" << std::endl;
return 0;
}
如果我这样做,那效果很好clang++ file.cpp
。如果我这样做是行不通的clang++ file.cpp -std=c++11
。我从这样的标准标题中得到错误:
In file included from file.cpp:1:
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/iostream:39:
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/ostream:39:
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/ios:39:
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/exception:150:
/usr/lib/gcc/i686-pc-cygwin/4.5.3/include/c++/exception_ptr.h:132:13: error:
unknown type name 'type_info'
const type_info*
Cygwin Clang 是否不能在打开 C++11 的情况下工作,或者我可以做些什么来解决这个问题?