简体   繁体   English

灾难性错误:无法打开源文件“stdlib.h”

[英]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/PackagesmacOS_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.

相关问题 macOS 10.15 Catalina 上的 Intel 编译问题:灾难性错误:无法打开源文件“stdlib.h” - Issue with Intel compilation on macOS 10.15 Catalina : catastrophic error: cannot open source file "stdlib.h" 无法在Visual Studio 2010中打开包含文件&#39;stdlib.h&#39; - Cannot open include file 'stdlib.h' in Visual Studio 2010 致命错误:stdlib.h:没有这样的文件或目录 - fatal error: stdlib.h: No such file or directory 75:15:致命错误:stdlib.h:没有这样的文件或目录#include_next <stdlib.h> - 75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> 无法在 mint 20.1 上编译:stdlib.h:没有这样的文件或目录 - cannot compile on mint 20.1: stdlib.h: No such file or directory Windows上的Intel C ++编译器发生灾难性错误:无法打开源文件“ bits / unique_ptr.h” - Intel C++ compiler on Windows catastrophic error: cannot open source file “bits/unique_ptr.h” / usr / include / c ++ / 7 / cstdlib:75:15:致命错误:stdlib.h:没有这样的文件或目录#include_next <stdlib.h> - /usr/include/c++/7/cstdlib:75:15: fatal error: stdlib.h: No such file or directory #include_next <stdlib.h> /usr/include/c++/8/cstdlib:75:15:致命错误:stdlib.h:没有这样的文件或目录 - /usr/include/c++/8/cstdlib:75:15: fatal error: stdlib.h: No such file or directory Visual Studio 2010不能包含stdlib.h - visual studio 2010 cannot include stdlib.h mingw / include / c ++ / cstdlib:stdlib.h:没有这样的文件或目录 - mingw/include/c++/cstdlib: stdlib.h: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM