编译问题,十万火急,跪求各位给个答案!!!!!

juve1897 2005-08-16 08:06:37
编译时出现如下错误:
Compiling...
StdAfx.cpp
e:\setup\test\common\glog.h(39) : error C2440: 'default argument' : cannot convert from 'char [1]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
e:\setup\test\common\glog.h(39) : error C2440: 'default argument' : cannot convert from 'char [2]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
e:\setup\test\common\glog.h(39) : error C2440: 'default argument' : cannot convert from 'char [3]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
e:\setup\test\common\glog.h(39) : error C2440: 'default argument' : cannot convert from 'char [1]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
e:\setup\test\common\glog.h(39) : error C2548: 'CGLog::CGLog' : missing default parameter for parameter 3
e:\setup\test\common\glog.h(39) : error C2548: 'CGLog::CGLog' : missing default parameter for parameter 4
e:\setup\test\common\glog.h(39) : error C2548: 'CGLog::CGLog' : missing default parameter for parameter 5
e:\setup\test\common\glog.h(39) : error C2548: 'CGLog::CGLog' : missing default parameter for parameter 6
e:\setup\test\test\stdafx.cpp(7) : error C2661: 'CGLog::CGLog' : no overloaded function takes 2 parameters
Error executing cl.exe.

Test.exe - 9 error(s), 0 warning(s)

错误行内容为:
CGLog(LPCTSTR p_lptPath, LPCTSTR p_lptFile, LPCTSTR p_lptModule = "", LPCTSTR p_lptOutLevel = "0", LPCTSTR p_lptLinesToFile = "50", LPCTSTR p_lptClearState = "");

...全文
110 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
timeflyok 2005-08-16
你将CGLog(LPCTSTR p_lptPath, LPCTSTR p_lptFile, LPCTSTR p_lptModule = "", LPCTSTR p_lptOutLevel = "0", LPCTSTR p_lptLinesToFile = "50", LPCTSTR p_lptClearState = "");
改为:CGLog(LPCTSTR p_lptPath, LPCTSTR p_lptFile, LPTSTR p_lptModule = "", LPTSTR p_lptOutLevel = "0", LPTSTR p_lptLinesToFile = "50", LPTSTR p_lptClearState = "");
再看看。
回复
younggle 2005-08-16
可能是用了Unicode的编译方式。
你可以不使用 Unicode的编译方式, 改为:
菜单:Build->Set Active Configuration->在弹出的对话框中选择 Win32 Debug 的一项
回复
dirdirdir3 2005-08-16
你用了Unicode吧,先把字符串转为Unicode再传进去。
回复
YanDong_8212 2005-08-16
前面是类型传递错误,VC下char 和const char被认为是不同的类型。
后面CGLog是重载问题。
回复
发帖
界面
创建于2007-09-28

1.5w+

社区成员

VC/MFC 界面
申请成为版主
帖子事件
创建了帖子
2005-08-16 08:06
社区公告
暂无公告