error c2248 in fstream

Hey Folks. I'm having a weird error and would greatly appreciate some help.

This is the error message I'm getting:
error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>' C:\Program Files\Microsoft Visual Studio 10.0\VC\include\fstream 1116



this is the line it says the error is located at.

1
2
3
4
5
6
7
    template<class _Elem,
    	class _Traits> inline
    	void swap(basic_ofstream<_Elem, _Traits>& _Left,
    		basic_ofstream<_Elem, _Traits>& _Right)
    	{	// swap _Left and _Right basic_ofstreams
    	_Left.swap(_Right);
    	}



this is the code where I access fstream

1
2
3
4
5
6
char* stringPointer =  (char*) Marshal::StringToHGlobalAnsi(saveFileNameString).ToPointer();
    
        
    ofstream sessionFile;
    sessionFile.open(stringPointer, std::ios_base::in);
     Marshal::FreeHGlobal(IntPtr(stringPointer));`


Thank you in advance!!!!
Topic archived. No new replies allowed.