使用vs2008 的OutputDebugString 时编译产生的错误

来源:互联网 发布:网络什么叫老司机 编辑:程序博客网 时间:2024/06/05 10:32

错误信息:

1. 中文版

“OutputDebugStringW”: 不能将参数 1 从“const char [18]”转换为“LPCWSTR”

2. 英文版

'OutputDebugStringW' : cannot convert parameter 1 from 'char [100]' to 'LPCWSTR'


原因:

OutputDebugString默认是Unicode方式,会变成OutputDebugStringW。

解决:

如果想用ANSI版本的,直接写OutputDebugStringA,或者设置工程属性,使用MBCS的编码集。


other: 这个错误的解决办法用中文还真难找。

原创粉丝点击