[英]catastrophic error: cannot open source file "stdlib.h"
When compiling a C++ project, I have recently begun to see the following error:最近在编译一个C++项目的时候,开始看到如下错误:
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h(94): catastrophic error: cannot open source file "stdlib.h"
#include_next <stdlib.h>
This is very strange because the offending line #include_next <stdlib.h>
is within the file /Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h
meaning the file is somehow trying to include itself and failing.这很奇怪,因为违规行
#include_next <stdlib.h>
位于文件/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h
这意味着该文件以某种方式试图包含自身并失败。
This is a default system file so I don't understand why it should be broken suddenly.这是一个默认的系统文件,所以我不明白为什么它会突然被破坏。 And advice would be greatly appreciated.
和建议将不胜感激。
(Running on macOS Mojave with Intel icpc compiler) (使用 Intel icpc 编译器在 macOS Mojave 上运行)
这个问题最终通过运行位于/Library/Developer/CommandLineTools/Packages
的macOS_SDK_headers_for_macOS_10.14.pkg
安装程序解决
以下命令在 MacOSX Big Sur 上帮助了我: export CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.