Some sort of context, such as the rest of the code, which compiler is used, the line number where the error occurs, etc.
This code compiles without error in two different compilers, including TDM-GCC 4.7.1 32-bit.
1 2 3 4 5 6 7 8 9 10 11 12
#include <fstream>
using std::fstream;
int main()
{
fstream streamFile;
streamFile.open ( "C:\\path\\to\\textFile.txt",
fstream::in | fstream::out| fstream::app);
return 0;
}
Edit
It looks as through an error like this may occur when trying to make a copy of a stream. (But that isn't indicated in the above code fragment, perhaps it's elsewhere in the program?)
Well, the root of the error is that a stream may not be copied. If you want the class member to be a stream rather than a pointer, don't attempt to assign to it. Instead, do all open/close etc. directly with that member.