标题:帮看下这个警告时什么意思
只看楼主
sudong0913
Rank: 1
等 级:新手上路
帖 子:38
专家分:5
注 册:2009-4-15
结帖率:76.92%
已结贴  问题点数:17 回复次数:3 
帮看下这个警告时什么意思
H:\temp\vc6++\df\dfa.cpp(25) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_t
raits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255' characters in the debug information
H:\temp\vc6++\df\dfa.cpp(25) : warning C4786: 'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<
char>,std::allocator<char> > &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters in the debug information
h:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
 >::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
h:\program files\microsoft visual studio\vc98\include\vector(52) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
 >::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
h:\program files\microsoft visual studio\vc98\include\vector(60) : warning C4786: 'std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >
 >::~vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
Linking...
///////////////////////////////////////////////////////////////////
#include<iostream>
#include<vector>
#include<cctype>
#include<string>
using namespace std;
vector<string> split(const string & x)
{
    vector<string> v;
    typedef vector<string>::size_type string_size;
    string_size i=0;
    while(i!=x.size())
    {
        while(i!=x.size()&&isspace(x[i]))
            ++i;
        string_size j=i;
        while(j!=x.size()&&!isspace(x[j]))
            ++j;
        if(i!=j)
        {
            v.push_back(x.substr(i,j-i));
            i=j;
        }
    }
    return v;
}
void main()
{
}

[ 本帖最后由 sudong0913 于 2010-9-10 23:05 编辑 ]
搜索更多相关主题的帖子: 警告 
2010-09-10 23:04
staor
Rank: 2
等 级:论坛游民
帖 子:12
专家分:45
注 册:2010-9-5
得分:10 
头文件不该是
#include   <iostream>
#include   <vector>
#include   <string>
这样的吧?应该是:
#include   <iostream.h>
#include   <vector.h>
#include   <string.h>
吧。

你改一下再试试

大概判断应该是调试时一些类调用后导致名字过长,超过了255个字符,产生,

今天网上找了下,问题是因为VC6对STL的一些不完全支持造成,手工屏蔽就可以。

方法为在源文件头部加入一下预编译代码

#ifdef WIN32
#pragma warning (disable: 4514 4786)
#endif
或者

这是因为VC6对新标准支持力度不够,STL中的map等等的实现中名字过长,被VC6截断了.
可以用#pragma   warning   (disable:4786)消除相应的警告.

问题解决。
2010-09-11 02:14
x_wangyue
Rank: 3Rank: 3
等 级:论坛游侠
威 望:1
帖 子:34
专家分:144
注 册:2010-8-30
得分:7 
#pragma warning(disable:4786)//加上这句就行了
#include<iostream>
#include<vector>
#include<cctype>
#include<string>
using namespace std;
vector<string> split(const string & x)
{
    vector<string> v;
    typedef vector<string>::size_type string_size;
    string_size i=0;
    while(i!=x.size())
    {
        while(i!=x.size()&&isspace(x[i]))
            ++i;
        string_size j=i;
        while(j!=x.size()&&!isspace(x[j]))
            ++j;
        if(i!=j)
        {
            v.push_back(x.substr(i,j-i));
            i=j;
        }
    }
    return v;
}
void main()
{
}

2010-09-13 19:59
傲剑
Rank: 2
等 级:论坛游民
帖 子:51
专家分:28
注 册:2009-11-2
得分:0 
回复 2楼 staor
C++头文件不用加.h吧
2010-09-13 20:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-320039-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.175184 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved