1

So I've got this problem with Code::Blocks 12.11 where I try and compile a simple program and get a seemingly common error.

c:\program files (x86)\codeblocks\mingw\bin../lib/gcc/mingw32/4.7.1/include/c++/ostream:40:15: fatal error: ios: No such file or directory

Upon getting this error, Code::Blocks then proceeds to open ostream and marks line 40 which is:

#include <ios>

The file I created is appropriately named with a .cpp extension, which is what I thought the problem was in the first place, but one computer in particular among many is having this issue. I've tried repairing, uninstall and installing, and auto-detecting the compilers installation directory (C:\Program Files (x86)\CodeBlocks\MinGW). I've tried running as an admin as well as making sure the install was done as an admin.

I'm not sure what to try from here.

Here's the simple code.

#include <iostream>

using namespace std;

int main()
{
    cout << "test";

    return 0;
}
Gnaglor
  • 11
  • 3
  • Change this `#include ` to `#include ` – Midhun MP Apr 01 '14 at 20:31
  • The simple code I listed is how the program is compiled, meaning I used #include in the first place. After compiling and getting my error message, Code::Blocks immediately opens ostream, marks line 40: in the ostream header, and what is on line 40 is nothing other than #include . Unless you're suggesting I should change the ostream header file to say #include instead of #include , but wouldn't I be changing how ostream is intended to function if I do so? Why would a built in header file be wrong from a fresh install? – Gnaglor Apr 01 '14 at 20:56
  • In that case check whether `ios` header file is available in your machine. Use "" instead of <>. – Midhun MP Apr 02 '14 at 04:08
  • I checked for ios and it exists on my machine at 'C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++' and 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include'. – Gnaglor Apr 03 '14 at 14:25

1 Answers1

0

This isn't necessarily an answer so much as a workaround. The instructor and powers that be are fine with upgrading to the newest version, which doesn't necessarily fix the problem, but it got us past it.

Just out of curiosity, I went back and reinstalled 12.11 to see what would happen and everything seems to work alright. Unfortunate that the reason for all this won't be known, but that's the nature of IT most of the time.

Gnaglor
  • 11
  • 3