vc6下, error C2002: invalid wide-character constant

Longerandlonger 2010-11-19 03:09:53
最近看看clucene的东西,下载源码了,用vc6运行里面的“test.dsw”文件,按F7,出现了65个同样的错误。

求问,这是怎么回事?该怎么解决?
...全文
315 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhoujc1563172464 2010-11-20
  • 打赏
  • 举报
回复
出现无效字符。重新输一遍就可以了。
無_1024 2010-11-20
  • 打赏
  • 举报
回复
解决方法:使用UE打开文件,然后“文件”“另存为”,在保存对话框中,选择“换行符”为“Dos换行符”,选择“格式”为“ANSI编码”。重新打开VC,编译,通过!

無_1024 2010-11-20
  • 打赏
  • 举报
回复
無_1024 2010-11-20
  • 打赏
  • 举报
回复
TCHAR 为什么是TCHAR
Longerandlonger 2010-11-20
  • 打赏
  • 举报
回复
这么冷门,自顶一下。2楼的方法貌似不行。
Longerandlonger 2010-11-19
  • 打赏
  • 举报
回复
提示错误出现在这里:
  void testISOLatin1AccentFilter(CuTest *tc){
TCHAR str[200];
_tcscpy(str, _T("Des mot cl\xe9s \xc0 LA CHA\xceNE \xc0 \xc1 \xc2 ") //Des mot cl閟 ?LA CHA蜰E ???
_T("\xc3 \xc4 \xc5 \xc6 \xc7 \xc8 \xc9 \xca \xcb \xcc \xcd \xce \xcf") //?????????????
_T(" \xd0 \xd1 \xd2 \xd3 \xd4 \xd5 \xd6 \xd8 \xde \xd9 \xda \xdb") //?????????????
_T(" \xdc \xdd \xe0 \xe1 \xe2 \xe3 \xe4 \xe5 \xe6 \xe7 \xe8 \xe9 ") //???????????
_T("\xea \xeb \xec \xed \xee \xef \xf0 \xf1 \xf2 \xf3 \xf4 \xf5 \xf6 ") //?????????????
_T("\xf8 \xdf \xfe \xf9 \xfa \xfb \xfc \xfd \xff") //????????
_T(" ") ); //room for extra latin stuff
龙哥依旧 2010-11-19
  • 打赏
  • 举报
回复
Compiler Error C2002

Error Message
invalid wide-character constant


The multibyte-character constant is not valid.

To fix by checking the following possible causes
The wide-character constant contains more bytes than expected.

The standard header STDDEF.h is not included.

Wide characters cannot be concatenated with ordinary string literals.

A wide-character constant must be preceded by the character 'L':

Copy Code
L'mbconst'


For Microsoft C++, the text arguments of a preprocessor directive must be ASCII. For example, the directive, #pragma message(L"string"), is not valid.

wyfwx 2010-11-19
  • 打赏
  • 举报
回复
工程路径设置

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧