尝试在vc ++ 2008 express中wcout wstring时,我收到一条相当奇怪的错误消息:
错误C2679:二进制'<<':没有找到哪个运算符采用'std :: wstring'类型的右手操作数(或者没有可接受的转换)
如果我理解正确的话,它会报告wcout不接受wstring?我请求有人在linux下编译这段代码,运行正常。我也尝试使用vc ++ 2008 express在另一台计算机上使用相同的代码但仍然失败。 vc ++ 2008中std的已知问题?
#include <iostream>
int main()
{
std::wstring unicode_test = L"Unicode var";
std::wcout << L"Unicode non-var" << std::endl;
std::wcout << unicode_test << std::endl; //<-- This line fails!
}
我正在使用vc ++ 2008 express sp1,所有更新都达到KB948127。我知道控制台需要更改代码页,但这甚至都没有编译。谢谢。