I've essentially copied a small project from another computer to this one. This one is running windows 8.1.

What happens when I try to compile even a hello world cpp project I get this error: 'Fatal error: "iostream" No such file or directry' . I know this means the compiler cannot find the file where it is searching. But why? I'm using CodeBlocks with MingW on both computers. Hello world and my project compiler just fine on the other one, yet I have never been able to get even a hello world to work on this Windows 8.1 machine.

I tried adding include paths (using any include folders I could find with the windows search feature) via the menu bar "settings->compiler options..." and that kind of solved the problem. Only after I did that another few errors cropped up that are so arcane I cannot fathom what they mean.

The compiler is complaining about missing includes from within included files!

Apologies if this is very basic; I just don't understand why this isn't working right out of the box.

Could you post your includes etc. code please.

I thought it was obvious but the only thing the hello world program is including is iostream. As for my project:

#include "File.h"
#ifndef FILEREADER_H_INCLUDED
#define FILEREADER_H_INCLUDED

#endif // FILEREADER_H_INCLUDED

#ifndef STRING_INCLUDED
#define STRING_INCLUDED
#include <string>

#endif // STRING_INCLUDED
#ifndef FSTREAM_INCLUDED
#define FSTREAM_INCLUDED
#include <fstream>
#endif // FSTREAM_INCLUDED

#ifndef SSTREAM_INCLUDED
#define SSTREAM_INCLUDED
#include <sstream>
#endif // FSTREAM_INCLUDED

#ifndef IOSTREAM_INCLUDED
#define IOSTREAM_INCLUDED
#include <iostream>
#endif // IOSTREAM_INCLUDED

It's more common to put your header guards inside the header file, and all the standard headers will already have header guards.

I feel like you guys are yanking my chain here.

Those include guards (though not explicitly stated by I, my fault) are indeed inside of my header. Of course the standard headers contain the correct include guards it is professionally written code.

Incorrectly installed compiler? Really? Everything on windows is installed via a Wizard. Its almost impossible to screw up and I'm experienced enough with Windows to know that I did not screw it up.

Holy shit I just solved it. As it turns out I had an older version of MingW the CodeBlocks IDE was autodetecting. The path to it was under "C:/MinGW" while the CodeBlocks installer had put the newest version beneath "C:/ProgramFiles(x86)/CodeBlocks/MingW32". I had to get home and take a look at my desktop to compare configurations. Its so obvious now!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.