Fatal error 'stdio.h' not found

前端 未结 2 1456
青春惊慌失措
青春惊慌失措 2020-12-21 09:25

Why am I getting this message? The compiler is clang. Here is a simple program where it occurs for examples sake:

#include

int fib(int);
int          


        
相关标签:
2条回答
  • 2020-12-21 09:49

    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

    0 讨论(0)
  • 2020-12-21 09:56

    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:

    #include <stdio.h>
    #include <stdlib.h>
    
    int main(int argc, char **argv) {
        printf("Hello World!\n");
        return EXIT_SUCCESS;
    }
    
    0 讨论(0)
提交回复
热议问题