致命错误“stdio.h”未找到
为什么我会收到此消息?编译器是 clang 的。这是一个简单的程序,出于示例目的:
#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);
}
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);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设 C
是标准 C 头文件之一。您的编译器抱怨它找不到此标头。这意味着您的标准库已损坏。考虑重新安装编译器。
假设 C++
是 C 标准头,对于 C++,我们使用
代替。尽管
仍然需要存在于 C++ 中,所以这可能不是问题。除了这些假设之外,(根据您的编码风格和标签)您似乎很可能正在使用 C。尝试将其作为一些示例代码。 (我)保证可以在工作的 C 编译器上进行编译,如果不能,那么你的编译器就严重损坏了,你必须安装另一个/重新安装:
Assuming 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.Consider reinstalling your compiler.
Assuming 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.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:
在 Visual Studio 2017 中使用 C++ 时,我遇到了与此类似的运行时错误。我的解决方案是简单地清理并重建解决方案
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