小编use*_*694的帖子

在OSX 10.9.1上使用g ++进行编译时出错:未知类型名称'__darwin_wctype_t'

在使用g ++从命令行编译OSX 10.9.1时甚至编译基本代码(我以hello world为例)

#include <iostream>

int main() {std::cout << "Hello World";}
Run Code Online (Sandbox Code Playgroud)

我用命令编译:

g++ hello.cc -o hw
Run Code Online (Sandbox Code Playgroud)

这会生成以下错误消息:


In file included from hello.cc:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:215:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iosfwd:90:
In file included from /usr/include/wchar.h:92:
In file included from /usr/include/_wctype.h:47:
/usr/include/_types/_wctype_t.h:31:9: error: unknown type name
      '__darwin_wctype_t'
typedef __darwin_wctype_t wctype_t;
        ^
In file included from hello.cc:1:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__locale:15:
In file …
Run Code Online (Sandbox Code Playgroud)

c++ macos osx-mavericks

10
推荐指数
1
解决办法
2816
查看次数

标签 统计

c++ ×1

macos ×1

osx-mavericks ×1