简单的宽字符转换,头文件报错
想做wchar_t转换,但是一包含这个#include <winnls.h>头文件就报错,不知道为何。
#include <iostream>
#include <stdlib.h>
#include <string>
#include <wchar.h>
#include <winnls.h>
#define MAX_PATH 100
using namespace std;
int main(void)
{
wchar_t strPath[MAX_PATH];
char buf[] = "函数集,fun 1";
mbstowcs( strPath, buf, MAX_PATH );
MultiByteToWideChar(CP_ACP, 0, buf, strlen(buf), strPath, MAX_PATH );
cout<<strPath<<endl;
for(int i;i<MAX_PATH;i++)
cout<<strPath[i]<< " ";
return 0;
}
error C2146: syntax error : missing ';' before identifier 'LCTYPE'
include\winnls.h(616) : fatal error C1004: unexpected end of file found
为何头文件会出错??