发新话题
打印

标准库的bug还是...?

标准库的bug还是...?

如下代码,使用了宽字符:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main(int argc, char *argv[])
{
    wchar_t widestring;
    string narrowstring;
    ......
    cin >> narrowstring;
    of << narrowstring << endl;
    wcin >> widestring;
    wcout << widestring << endl;
    ......
}
在VC下编译正常,但在DEV-C++中编译无法通过
报:wcin,wcout未定义。
搜了一下库文件,发现要指定宏_GLIBCPP_USE_WCHAR_T,
加上编译项后又报:`vfwscanf' not declared
共有4个类似的错误提示,把这4个函数的using声明注释掉
(3个在头文件cwchar,1个在头文件cwctype),编译通过。
why?是还要加上什么编译选项,还是标准库的bug?
哪位能解释一下?谢谢!      

TOP

发新话题