设为首页 加入收藏

TOP

#pragma warning (disable : 4786)
2014-11-23 23:21:03 来源: 作者: 【 】 浏览:1
Tags:#pragma warning disable 4786

windows xp + VC6.0)
编译如下程序,初始化vector,在 容器中放入10个“hello”:

#include "stdafx.h"
#include
using namespace std;

int main(int argc, char* argv[])
{
vector vecStr(10, "hello");
return 0;
}
编译后出现如下错误:

warning C4786: 'std::reverse_iterator,std::allocator > const *,std::basic_string,std::allocator >,s
td::basic_string,std::allocator > const &,std::basic_string,std::allocator > const *,int>' : identifier was truncated to '255' characters in the debug information

这是模板展开后名字太长引起的!!!
标识符字符串超出最大允许长度,因此被截断。
调试器无法调试符号超过 255 个字符长度的代码。无法在调试器中查看、计算、更新或监视被截断的符号。
缩短标识符名称可以解决此限制。

解决办法如下:
在#include "stdafx.h"下一行加入
#pragma warning (disable : 4786)

完整程序为:

#include "stdafx.h"
#pragma warning (disable : 4786)
#include
using namespace std;

int main(int argc, char* argv[])
{
vector vecStr(10, "hello");
return 0;
}
作者 “8023”

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇带头的单链表的逆转 下一篇用C语言进行CGI程序设计

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: