the fatal error "fstream.h" file not found happen in Clion?

1.8k Views Asked by At

When I use the code #include <ofstream.h> in my .h file I get this error:

"fstream.h" file not found

I use the Clion in os x.

1

There are 1 best solutions below

0
On

In C++ you should not include files (system-files), which ends with .h, instead do #include <fstream>

see: http://en.cppreference.com/w/cpp/io/ofstream