Problem using list<string> 
Author Message
 Problem using list<string>

Hi,

I declare a variable to be

list<string> myvariable;

When I compile I get a large warning message for this, which I cannot read
the end of as it truncated to 255 characters in the debug output. It looks
something like.......

C:\StrTest\StrTest.cpp(21) : warning C4786:
'std::reverse_bidirectional_iterator<std::list<std::basic_string<char,std::c
har_traits<char>,std::allocator<char>

Quote:
>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocato

r<char> > > >::
iterator,std::basic_string<char,std::char_traits<char>,std::allocator<char>
Quote:
>,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 trunca
ted to '255' characters in the debug information

Does anyone know what the warning is supposed to say?  I have not had any
problems using the list<string> so far, but I would like to be able to get
rid of the warning.

Thanks in advance

Neil



Mon, 12 Jul 2004 01:28:53 GMT  
 Problem using list<string>

Quote:
> Hi,

> I declare a variable to be

> list<string> myvariable;

> When I compile I get a large warning message for this, which I cannot read
> the end of as it truncated to 255 characters in the debug output. It looks
> something like.......

> C:\StrTest\StrTest.cpp(21) : warning C4786:

'std::reverse_bidirectional_iterator<std::list<std::basic_string<char,std::c
Quote:
> har_traits<char>,std::allocator<char>

>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocato
> r<char> > > >::

iterator,std::basic_string<char,std::char_traits<char>,std::allocator<char>

Quote:
> >,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 trunca
> ted to '255' characters in the debug information

> Does anyone know what the warning is supposed to say?  I have not had any
> problems using the list<string> so far, but I would like to be able to get
> rid of the warning.

> Thanks in advance

> Neil

The warning can be ignored.  To prevent it from popping up, put the
following in your code before you include STL headers:

#pragma warning(disable:4786)

Tom



Mon, 12 Jul 2004 01:59:46 GMT  
 Problem using list<string>

Quote:
> Hi,

> I declare a variable to be

> list<string> myvariable;

> When I compile I get a large warning message for this, which I cannot read
> the end of as it truncated to 255 characters in the debug output. It looks
> something like.......

<snip evil 4786 warning>

Quote:
> Does anyone know what the warning is supposed to say?  I have not had any
> problems using the list<string> so far, but I would like to be able to get
> rid of the warning.

Yes, it's saying that the debug system cannot correctly handle symbol names
that are greater than 255 characters in length and that the list<string>
construct generates symbols that are too long.

You haven't had any problems because it only affects the de{*filter*}, not the
actual code.  In fact, if you try to generate a release verion, you'll note
that the warning goes away completely.

Getting rid of the warning can be somewhat difficult, due to the nature of
the preprocessor, but you'll want to start by trying merely to put:

#pragma warning(disable : 4786)

before

#include <list>
#include <string>

Hopefully that will work.



Mon, 12 Jul 2004 02:00:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. <<<<<<<Parsing help, please>>>>>>>>

2. using <string> problem

3. File Format conversion, ascii freeform -->.csv <-->.wk1<-->dbf<-->?HELP

4. Warnings using STL Map<string,string>

5. <<<>>>Need C code advice with functions and sorting.<<<>>>

6. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

7. >>>Windows Service<<<

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

9. STL help with list<string>

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

11. conflict using string from <string> and strstr fucntion from <string.h>

12. <<Borland C/C++ 5.0 Problem >>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

 
Powered by phpBB® Forum Software