stdio.h: no such file or directory

Nov 18, 2014 at 3:35am
so ive searched the web on this for a while and most of the feedback says to make sure it is a c++ file and not a c file. I am using a cpp file, as the file is called "main.cpp" I am still getting the "fatal error: stdio.h: No such file or directory" message when trying to compile.

I've narrowed it down to the #include <fstream> line

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    cout << "Hello\n";
    return 0;
}


I get the same error when running a simple program like this. I am using codeblocks 13.12 btw
Last edited on Nov 18, 2014 at 3:41am
Nov 18, 2014 at 4:30am
Have you tried uninstalling and reinstalling? You may have a misconfigured compiler/IDE.
Nov 18, 2014 at 4:44am
check settings->compiler(select your compiler from the drop down)->toolchain executables tab->autodetect.

most likely, if it does not find any compiler at all, you downloaded the version with no compiler. Btw, the third one is the one with compiler(MingW).
Nov 18, 2014 at 5:19am
it worked by reinstalling it thanks!! Glad i could use VS in its place in the meantime
Topic archived. No new replies allowed.