typedef std::vector<std::string> Vector_String 
Author Message
 typedef std::vector<std::string> Vector_String

My program defined a Vector_String type.
I compiled my program.Compiler gave me a warning:
c:\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_strin
g<char,std::char_traits<char>,std::allocator<char> > >
Quote:
>::~vector<std::basic_string<char,std::char_traits<char>,st

d::allocator<char>>,std::allocator<std::basic_string<char,s
td::char_traits<char>,std::allocator<char> > > >' :
identifier was truncated to '255' characters in the debug
information.

How can I resolve this error?

Thanks for your help!



Sun, 02 Oct 2005 17:03:17 GMT  
 typedef std::vector<std::string> Vector_String

Quote:

>My program defined a Vector_String type.
>I compiled my program.Compiler gave me a warning:
>c:\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_strin
>g<char,std::char_traits<char>,std::allocator<char> > >
>>::~vector<std::basic_string<char,std::char_traits<char>,st
>d::allocator<char>>,std::allocator<std::basic_string<char,s
>td::char_traits<char>,std::allocator<char> > > >' :
>identifier was truncated to '255' characters in the debug
>information.

>How can I resolve this error?

It isn't an error, just a warning. It is fairly harmless (at worst, it
might cause glitches when debugging), so you should just disable it.
Add this before all stl includes:

#pragma warning (disable: 4786)

Tom



Sun, 02 Oct 2005 19:49:09 GMT  
 typedef std::vector<std::string> Vector_String
In the March 2002 Windows Developer Magazine Tech Tips section:
http://www.wdj.com/wdm/articles/2002/0203/
Paul Hollingsworth gives an excellent description of a workaround for
#pragma(disable:4786) not working in VC6.  The include file is found here:
<ftp://ftp.wdj.com/pub/2002/mar2002.zip> -> tips.zip -> hollings.zip ->
Disable4786.h

---------------------------------------------------
Automate your software builds with Visual Build Pro
http://www.kinook.com


Quote:

> >My program defined a Vector_String type.
> >I compiled my program.Compiler gave me a warning:
> >c:\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_strin
> >g<char,std::char_traits<char>,std::allocator<char> > >
> >>::~vector<std::basic_string<char,std::char_traits<char>,st
> >d::allocator<char>>,std::allocator<std::basic_string<char,s
> >td::char_traits<char>,std::allocator<char> > > >' :
> >identifier was truncated to '255' characters in the debug
> >information.

> >How can I resolve this error?

> It isn't an error, just a warning. It is fairly harmless (at worst, it
> might cause glitches when debugging), so you should just disable it.
> Add this before all stl includes:

> #pragma warning (disable: 4786)

> Tom



Sun, 02 Oct 2005 20:32:50 GMT  
 typedef std::vector<std::string> Vector_String


Quote:

> >My program defined a Vector_String type.
> >I compiled my program.Compiler gave me a warning:
> >c:\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_strin
> >g<char,std::char_traits<char>,std::allocator<char> > >
> >>::~vector<std::basic_string<char,std::char_traits<char>,st
> >d::allocator<char>>,std::allocator<std::basic_string<char,s
> >td::char_traits<char>,std::allocator<char> > > >' :
> >identifier was truncated to '255' characters in the debug
> >information.

> >How can I resolve this error?

> It isn't an error, just a warning. It is fairly harmless (at worst, it
> might cause glitches when debugging), so you should just disable it.

Isn't this warning VC6 specific? I believe it no longer appears with VC7 but
I am not sure whether it is compiler or stl implementation thing.


Mon, 03 Oct 2005 04:15:17 GMT  
 typedef std::vector<std::string> Vector_String

Quote:





>>> My program defined a Vector_String type.
>>> I compiled my program.Compiler gave me a warning:
>>> c:\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_strin
>>> g<char,std::char_traits<char>,std::allocator<char> > >
>>>>> :~vector<std::basic_string<char,std::char_traits<char>,st
>>> d::allocator<char>>,std::allocator<std::basic_string<char,s
>>> td::char_traits<char>,std::allocator<char> > > >' :
>>> identifier was truncated to '255' characters in the debug
>>> information.

>>> How can I resolve this error?

>> It isn't an error, just a warning. It is fairly harmless (at worst,
>> it might cause glitches when debugging), so you should just disable
>> it.

> Isn't this warning VC6 specific? I believe it no longer appears with
> VC7 but I am not sure whether it is compiler or stl implementation
> thing.

Compiler.  They increased the size to, if I recall correctly, 65535.

Someone reported (in another group) that some of the very advanced template
libraries can still trip the warning, but it's pretty rare now.

--
Reginald Blue



Mon, 03 Oct 2005 04:26:28 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Warnings for std::vector<std::string>

2. vector<std::string>

3. std::vector<user-defined class>

4. std::vector<int[2]> intializing trouble

5. std::vector<CClass*> / destructors

6. std::list<string>::sort (Cmp)

7. std::list<string>::sort (Cmp)

8. bug: VS7.0 (6.0) C++ std::auto_ptr conflict with std::vector

9. convert non std::string to std::string

10. export classes using std namespace (ex std::vector) in a DLL

11. std::list, std::vector, push_back() and associated ::iterator validity

12. C4251 warning using std::vector<std::string>

 

 
Powered by phpBB® Forum Software