User forums => Using Code::Blocks => Topic started by: Maulrus on June 03, 2010, 03:03:03 am
Title: Missing ifstream and ofstream
Post by: Maulrus on June 03, 2010, 03:03:03 am
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?
Title: Re: Missing ifstream and ofstream
Post by: ollydbg on June 03, 2010, 04:31:40 am
It should work ok. Post your full build log. Post your code, then others can test for you.
Title: Re: Missing ifstream and ofstream
Post by: Maulrus on June 03, 2010, 04:56:30 am
Build log:
Quote
Compiling: 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:
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.
Title: Re: Missing ifstream and ofstream
Post by: ollydbg on June 03, 2010, 05:04:12 am
ifstream - C++ Reference (http://www.cplusplus.com/reference/iostream/ifstream/ifstream/)
BTW: this question is totally unrelated to Codeblock, so, it violate the forum rule!!!
Title: Re: Missing ifstream and ofstream
Post by: Maulrus on June 03, 2010, 05:10:30 am
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.
Title: Re: Missing ifstream and ofstream
Post by: ollydbg on June 03, 2010, 05:17:55 am
No, please reread the link carefully, the ifstream class is declared in fstream .
BTW: My last post in this thread.
Title: Re: Missing ifstream and ofstream
Post by: Maulrus on June 03, 2010, 05:20:25 am
Wow I am a dumbass.
Sorry for refusing your help earlier, this can be deleted or closed or whatever.