您的位置:首页 > 其它

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

2008-10-21 18:09 387 查看
今天解码工作中增加一个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

loadTOCNode(1, 'resolution');

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: