News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Missing ifstream and ofstream

Started by Maulrus, June 03, 2010, 03:03:03 AM

Previous topic - Next topic

Maulrus

I just installed Code::Blocks 10.5 with MinGW. I'm compiling a project when it gives me an error: ifstream: No such file or directory. I get the same error for ofstream. I go into the include folders and, to my surprise, they're not there! Everything else seems to be, including fstream, is in there. What happened, and where can I get these headers?

ollydbg

It should work ok.
Post your full build log.
Post your code, then others can test for you.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Maulrus

Build log:

QuoteCompiling: C:\CodeBlocks\Exercises\test.cpp
C:\CodeBlocks\Exercises\test.cpp:1:20: error: ifstream: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings

Code:

#include <ifstream>

int main(){}


This wasn't the code that I had the problem with originally, but it still gives me the same error.

ollydbg

ifstream - C++ Reference

BTW: this question is totally unrelated to Codeblock, so, it violate the forum rule!!!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Maulrus

That link doesn't really help me at all.

I posted it here because I installed MinGW from the C::B installer, which led to me to believe the problem had something to do with C::B. I apologize if this is actually the wrong forum for it.

ollydbg

No, please reread the link carefully, the ifstream class is declared in fstream .

BTW: My last post in this thread.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Maulrus

Wow I am a dumbass.

Sorry for refusing your help earlier, this can be deleted or closed or whatever.