C语言 找不到致命错误“stdio.h”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5898199/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Fatal error 'stdio.h' not found
提问by jones
Why am I getting this message? The compiler is clang. Here is a simple program where it occurs for examples sake:
为什么我会收到这条消息?编译器是叮当的。这是一个简单的程序,为了举例,它发生了:
#include<stdio.h>
int fib(int);
int main()
{
int i;
scanf("%d",&i);
printf("The fibonacci number that is %i'th in the sequence is %i \n", i, fib(i));
return 0;
}
int fib(int n)
{
if (n==1 || n==0) return 1;
else return fib(n-1)+fib(n-2);
}
回答by orlp
Assuming C
假设 C
<stdio.h>is one of the standard C headers. Your compiler complains that it can not find this header. This means that your standard library is broken.
<stdio.h>是标准的 C 头文件之一。您的编译器抱怨它找不到这个头文件。这意味着您的标准库已损坏。
Consider reinstalling your compiler.
考虑重新安装编译器。
Assuming C++
假设 C++
<stdio.h>is the C standard header, with C++ we use <cstdio>instead. Though <stdio.h>is still required to exist in C++, so this probably isn't the problem.
<stdio.h>是 C 标准头文件,我们使用 C++<cstdio>来代替。虽然<stdio.h>在 C++ 中仍然需要存在,所以这可能不是问题。
Apart from these assumptions, it seems most likely (by your coding style and tags) that you are using C. Try this as some example code. This is guaranteed (by me) to compile on a working C compiler, if it doesn't then your compiler is horribly broken and you must install another one/reinstall:
除了这些假设之外,似乎(根据您的编码风格和标签)您最有可能使用 C。试试这个作为一些示例代码。这(由我)保证可以在工作的 C 编译器上编译,如果没有,那么你的编译器会严重损坏,你必须安装另一个/重新安装:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
printf("Hello World!\n");
return EXIT_SUCCESS;
}
回答by public wireless
I got a runtime error similar to this while using C++ in Visual Studio 2017. The solution in my case was to simply clean and rebuild the solution
在 Visual Studio 2017 中使用 C++ 时,我遇到了与此类似的运行时错误。我的解决方案是简单地清理并重建解决方案

