Home > Archive > VC STL > March 2005 > new to stl
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hello:
#include <string>
#include <vector>
#include <map>
using namespace std;
void foo()
{
vector<string> names;
:
:
:
}
when I use vector strings I get a lot of long warnings from VC++ 6.0
example:
c:\program files\microsoft visual studio\vc98\include\vector(48) : warning
C4786:
'??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV
?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z'
: identifier was truncated to '255' characters in the browser information
c:\panels.cpp(232) : see reference to class template instantiation
'std::vector<class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >,class
std::allocator<class std::basic_string<char,str
uct std::char_traits<char>,class std::allocator<char> > > >' being compiled
c:\program files\microsoft visual studio\vc98\include\vector(61) : warning
C4786:
'??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?
$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z'
: identifier was truncated to '255' characters in the browser information
and this couses the debugger to point to first line of winmain().
Could anyone please tell me what I do wrong if I want to have vector of
string or map of strings.
and this only happens when I use string in a container.
Thank You in advance for your help.
| |
| Jon Anglin 2005-03-14, 9:00 pm |
| This was a common issue in the VC++ 6.0 days. Luckily I haven't used that
version in quite a while. This warning is simply telling you that the
mangled C++ name was truncated to 255 characters in the browser database.
It does not effect the your compiled code.
Most people just turned this warning off with the following pragma:
#pragma warning( disable : 4786)
You will find a few other warnings similar to this one (I can't remember the
numbers). You can disable them in the same manner.
Jon
"Frank" <hero_2050@hotmail.com> wrote in message
news:LaadncjOn976dqjfRVn-1A@rogers.com...
> Hello:
>
> #include <string>
> #include <vector>
> #include <map>
> using namespace std;
>
> void foo()
> {
> vector<string> names;
> :
> :
> :
>
> }
>
> when I use vector strings I get a lot of long warnings from VC++ 6.0
> example:
>
> c:\program files\microsoft visual studio\vc98\include\vector(48) : warning
> C4786:
> '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV
> ?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z'
> : identifier was truncated to '255' characters in the browser information
>
>
> c:\panels.cpp(232) : see reference to class template instantiation
> 'std::vector<class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >,class
> std::allocator<class std::basic_string<char,str
> uct std::char_traits<char>,class std::allocator<char> > > >' being
> compiled
>
>
>
> c:\program files\microsoft visual studio\vc98\include\vector(61) : warning
> C4786:
> '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?
> $basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z'
> : identifier was truncated to '255' characters in the browser information
>
> and this couses the debugger to point to first line of winmain().
>
> Could anyone please tell me what I do wrong if I want to have vector of
> string or map of strings.
> and this only happens when I use string in a container.
>
> Thank You in advance for your help.
>
>
>
| |
| Jason Winnebeck 2005-03-14, 9:00 pm |
| Frank wrote:
> when I use vector strings I get a lot of long warnings from VC++ 6.0
This is a well-known issue with MSVC6 and can be safely ignored. Simply all
the compiler is saying is that the symbol's name is longer than 255
characters and is truncated in the debug information. I've never seen it
affect anyone, and any time you use parts of the STL this warning is
unavoidable, so there is nothing that can be done if it does affect you.
So, just simply ignore the error; optionally you can use #pragma to ignore
the warnings so they are not generated when you compile, to give you a clean
output.
Jason
| |
| CheckAbdoul 2005-03-14, 9:00 pm |
|
"Frank" <hero_2050@hotmail.com> wrote in message
news:LaadncjOn976dqjfRVn-1A@rogers.com...
> Hello:
>
> #include <string>
> #include <vector>
> #include <map>
> using namespace std;
>
> void foo()
> {
> vector<string> names;
> :
> :
> :
>
> }
>
> when I use vector strings I get a lot of long warnings from VC++ 6.0
> example:
>
> c:\program files\microsoft visual studio\vc98\include\vector(48) : warning
> C4786: ....
Add
#pragma warning(disable:4786)
as the first line in your code before including any header files.
Also see
FIX: C4786 Warning Is Not Disabled with #pragma Warning
http://support.microsoft.com/?id=167355
--
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------
| |
| Igor Tandetnik 2005-03-14, 9:00 pm |
| "Frank" <hero_2050@hotmail.com> wrote in message
news:LaadncjOn976dqjfRVn-1A@rogers.com
> when I use vector strings I get a lot of long warnings from VC++ 6.0
> example:
>
> c:\program files\microsoft visual studio\vc98\include\vector(48) :
> warning C4786:
This warning is annoying but harmless. You can safely disable it with
#pragma warning (disable: 4786)
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
| |
|
| Thank You all for helping me
"Frank" <hero_2050@hotmail.com> wrote in message
news:LaadncjOn976dqjfRVn-1A@rogers.com...
> Hello:
>
> #include <string>
> #include <vector>
> #include <map>
> using namespace std;
>
> void foo()
> {
> vector<string> names;
> :
> :
> :
>
> }
>
> when I use vector strings I get a lot of long warnings from VC++ 6.0
> example:
>
> c:\program files\microsoft visual studio\vc98\include\vector(48) : warning
> C4786:
> '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV
> ?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z'
> : identifier was truncated to '255' characters in the browser information
>
>
> c:\panels.cpp(232) : see reference to class template instantiation
> 'std::vector<class std::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >,class
> std::allocator<class std::basic_string<char,str
> uct std::char_traits<char>,class std::allocator<char> > > >' being
> compiled
>
>
>
> c:\program files\microsoft visual studio\vc98\include\vector(61) : warning
> C4786:
> '??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@PBV?
> $basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@0ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z'
> : identifier was truncated to '255' characters in the browser information
>
> and this couses the debugger to point to first line of winmain().
>
> Could anyone please tell me what I do wrong if I want to have vector of
> string or map of strings.
> and this only happens when I use string in a container.
>
> Thank You in advance for your help.
>
>
>
|
|
|
|
|