Discussion:
wofstream
(too old to reply)
Jack
2009-08-04 02:36:35 UTC
Permalink
I looked up wofstream in my .NET 2003 installation base. I could locate the
class (iosfwd), but when I included it in my project, #include <iosfwd.h>

Here it comes,

c:\Documents and Settings\Jacky\My Documents\Visual Studio
Projects\StringTest\StringTestDoc.cpp(60): error C2079: 'testFile' uses
undefined class 'std::basic_ofstream<_Elem,_Traits>'
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]

What is it all about?
Thanks in advance for any hints
Jack
Jack
2009-08-04 02:51:36 UTC
Permalink
Complement: I have included the file fstream
here is the whole list:
Thanks in advance for any help
#include <fstream>

#include <locale>

#include <iostream>

#include <ofstream>

#include <ostream>

#include <strstream>



#ifdef _DEBUG

#define new DEBUG_NEW

#endif

using namespace std;

#ifdef _UNICODE

#define tofstream wofstream

#define tstringstream wstringstream

// etc...

#else

#define tofstream ofstream

#define tstringstream stringstream

// etc...

#endif // _UNICODE
Goran
2009-08-04 12:06:17 UTC
Permalink
Post by Jack
What is it all about?
I don't know, but it looks like you should use <fstream> (no *.h) with
new code. I think that *.h variants of C++ headers are from older C++
standard lib.

Goran.

Loading...