Reputation: 122450
For some reason, my project won't compile when I try to create a wstringstream
:
std::wstringstream stringstream;
This causes error C2079:
'stringstream' uses undefined class 'std::basic_stringstream<_Elem, _Traits, _Alloc> with [_Elem=wchar_t, _Traits=std::char_traits, _Alloc=std::allocator'
What am I doing wrong?
Upvotes: 3
Views: 7386
Reputation: 7180
The compiler complains that wstringstream
is undefined. Normally if unicode is enabled this call should be included when you include sstream
. Right-click your VC++ project, set :-
Configuration Properties -- > General -- > Character Set --> "Use Unicode Character Set"
See if this works for you...
Upvotes: 0
Reputation: 3593
I think your problem is the stringstream
variable name. The compiler is recognizing it as a type. Try changing the variable name to something else as a test.
Upvotes: 2