简单的宽字符转换,头文件报错

perfecth perfecth 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
想做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


为何头文件会出错??

...全文
评论 5
收藏 已收藏
分享
返回顶部
perfecth
新手乐园 33,314 成员 41,769 内容