头疼啊,刚开始用 stl 写代码 就碰见了两个巨长的 warning 怎么解决呀

hbs_biscuit 2003-05-06 03:46:20
MsgCenter.cpp
e:\microsoft visual studio\vc98\include\xstring(579) : warning C4503: 'insert' : decorated name length exceeded, name was truncated
e:\microsoft visual studio\vc98\include\xstring(579) : warning C4503: 'pair<class std::_Tree<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::pair<class std::basic_string<char,struct std::char_trait
s<char>,class std::allocator<char> > const ,class std::deque<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator
<char> > > > *>,struct std::map<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::deque<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<cla
ss std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::deque<class std::ba
sic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *> >::_Kfn,struct std::less<class std::basic_string<char,stru
ct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::deque<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char
_traits<char>,class std::allocator<char> > > > *> >::iterator,bool>::pair<class std::_Tree<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::pair<class std::basic_string<char,struct std::char_traits<
char>,class std::allocator<char> > const ,class std::deque<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<c
har> > > > *>,struct std::map<class std::basic_string<ch
r,struct std::char_traits<char>,class std::allocator<char> >,class std::deque<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,cla
ss std::allocator<char> > > > *,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::deque<class std::basic_string<char,struct std::char_traits<char>,class std::al
locator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *> >::_Kfn,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,cl
ass std::allocator<class std::deque<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > *> >::iterat
or,bool>' : decorated name length exceeded, name was truncated
Generating Code...
Linking...
Creating library Debug/MessageCenter.lib and object Debug/MessageCenter.exp
Performing registration

MessageCenter.dll - 0 error(s), 2 warning(s)
...全文
257 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
hbs_biscuit 2003-05-09
  • 打赏
  • 举报
回复
谢谢各位了,揭帖
SwordMan2001 2003-05-09
  • 打赏
  • 举报
回复
dev-c++用起来真是很不爽
特别是调试麻烦得很,有的程序还不能调试,也不知什么原因
maojincxj 2003-05-08
  • 打赏
  • 举报
回复
vc对标准支持不好,
请用dev-c++,很好
www.bloodshed.org
kingcomRapeIsharp 2003-05-08
  • 打赏
  • 举报
回复
兄弟们!俺kingcom_xu又回来啦! 俺以前帮过你们不少忙,这次你们一定要救我啊!我的私生子,叫21bird,居然要砍我!555~~~~~~~
lifanxi 2003-05-06
  • 打赏
  • 举报
回复
同意楼上说法,可参考
http://expert.csdn.net/Expert/topic/1410/1410599.xml?temp=.9795038
短歌如风 2003-05-06
  • 打赏
  • 举报
回复
补充一句:
warning C4786是同样原因导致的另一个警告,在我的程序经常出现的。所我一般我在新建一个工程中第一步就是在stdafx.h中屏蔽掉这两个warning。
ghtsao 2003-05-06
  • 打赏
  • 举报
回复
这样去掉是对的,但警告依然存在,只不过可以让它不显示吧了!这是STL模板的问题,不用理会,不影响使用。
#pragma warning(4503: disable)
短歌如风 2003-05-06
  • 打赏
  • 举报
回复
少写了一个4:
#pragma warning( disable : 4503 4786)
短歌如风 2003-05-06
  • 打赏
  • 举报
回复
这是因为VC调试信息在处理模板实例化生成的长标识符的能力不足的原因,对你的程序运行没有影响,你可以不用理它。
在你的stdafx.h中加进这一行:
#pragma warning( disable : 503 4786)
就可以不让它显示些警告信息了。
XmagicX 2003-05-06
  • 打赏
  • 举报
回复
同意
afu 2003-05-06
  • 打赏
  • 举报
回复
VC6 编译器的问题,换个编译器就好了
merlinran 2003-05-06
  • 打赏
  • 举报
回复
decorated name length exceeded, name was truncated
只需要看这一句就行了。
实际上是模板展开后的标识符长度超过了编译器限制。不用管它。或者用:
#pragma warning(4503: disable)压制它。

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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