【发布时间】:2020-05-01 17:10:22
【问题描述】:
全新的项目完全没问题,但我发现了相当老的开源项目并想编译它。基本上,包含iostream 或algorythm 之类的标头时会出现错误。
我的环境如下所示:
- MacOS 10.15.4
- Clang 11.0.3
- Cmake 3.16.5
- 这里安装了工具和头文件
/Library/Developer/CommandLineTools/usr/bin - 项目使用 cotire 1.8.0
- IDE - CLion
一般来说,项目由 30 多个子项目组成,有些是 C,有些是 C++。只有 C 中的那些可以被构建。
我一直在尝试很多东西:为 Cmake 设置目标版本,设置手动查找头文件的路径(在 Cmake 文件中)。重新安装开发者工具也无济于事。
请查看原始错误消息:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iostream:37:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ios:214:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iosfwd:95:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/wchar.h:118:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/wchar.h:92:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_wctype.h:42:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/__wctype.h:62:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types/_wctype_t.h:32:9: error: unknown type name '__darwin_wctype_t'
typedef __darwin_wctype_t wctype_t;
更新 1
我向前移动了一点,发现stdafx.h 甚至不能包含iostream。所以我会检查所有包含路径。
【问题讨论】: