User forums > Help

fstream: No such file or directory

(1/2) > >>

deepak643:
When I include fstream, my program throws

fatal error: fstream: No such file or directory.

How to resolve this? It seems to be wierd.. I am using gcc compiler.

Please suggest

oBFusCATed:
gcc or g++? .c or .cpp? Have you read the FAQ on the wiki.codeblocks.org?

deepak643:
I am using GCC (not g++).
Its a C program (.c).

I checked the FAQ in this forum.. the below is the thread I have found.. but i didn't find it useful.

http://forums.codeblocks.org/index.php?topic=12666.msg%25msg_id%25

oBFusCATed:

--- Quote from: deepak643 on March 08, 2014, 04:21:17 am ---Its a C program (.c).

--- End quote ---
Then why are you trying to use a c++ header? This is never going to work.

SuperBoi45:
<fstream> is a C++ file. Are you trying to use the standard C++ file stram std::fstream? If so, then make a C++ project. For C projects you have to use <cstdio> and FILE*.

Navigation

[0] Message Index

[#] Next page

Go to full version