VC下关于map容器类引起的问题?

 

今天解码工作中增加一个CAtomDicti类,它封装了一个

private:
 map<string, CAtom *> m_mapDicti;

的数据成员,但是编译的时候VC下出现了一大堆C4786的警告,我查机子上的msdn, 索引 ---> 查找:

输入

C4786,结果查到的是C4788,我晕,我还看了十来分钟那个警告,后来才发现不是同一个警告,后来上

msdn online查,查到了原因:

http://support.microsoft.com/kb/195386/zh-cn

不看机器翻译的中文,简直翻译得一窍不能。看下面的英文原文:

点击这里察看该文章的英文版: 195386

http://support.microsoft.com/kb/195386/en-us/

你可以看到这样一句:

RESOLUTION

<script type=text/javascript>loadTOCNode(1, 'resolution');</script>
In Visual C++ 5.0, using the following
   #pragma warning (disable : 4786)
				
after including STL headers, disables the warning:
C4786:'identifier' : identifier was truncated to 'number' characters in the debug information.
However, this method does not disable all such warnings in Visual C++ version 6.0. The occurrence of many C4786 warnings may result in the following:
C1033 error: cannot open program database 'vc60.pdb'.
Use the pragma directive before you include any STL headers to disable the warnings.

 

因此,你照文中所言的:在STL模板类的头文件之前加上一句:

#pragma warning (disable : 4786)

就大功告成了。

呵呵,还是要耐心看英文才能解决问题啊?

 

 

 

实际上我是在google上搜:  map C4786

结果搜到了以下文章,http://blog.chinaunix.net/u1/43391/showart_430055.html

才认识到是自己没有认真看 msdn 的后果。555555555555

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值