Results 1 to 6 of 6

Thread: vector of strings

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    195

    vector of strings

    Does anyone else get all of those warnings when using a vector of strings? The program I'm doing does still work, but the warnings are really annoying since they hide all of the real errors. Can I resolve the warnings somehow?
    Last edited by Barguast; Dec 8th, 2003 at 04:52 PM.
    Using Visual Studio .NET 2005

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    What are you talking about? I get no errors...

    When you have questions about any errors or warnings, ask yourself... SELF, do they need to know what compiler I am using? SELF, do they need to see the code I am getting errors with?

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    195
    ... it says what compiler I'm using in the sig - Visual Studio 6.0. As for the warnings, well there are over 20 of them, and they don't really say much, for example this is just one of 'em:
    Code:
    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:\documents and settings\jwinder\my documents\university\distributed systems programming\cc_client\socket.h(17) : see reference to class template instantiation 'std::vector<class std::basic_string<char,struct std::char_traits<char>,cla
    ss std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >' being compiled
    I presumed that since I'm just using a simple declaration that this is something everyone would've noticed themselves.

    The declaration is just:
    Code:
    vector <string> vMessages;
    Last edited by Barguast; Dec 8th, 2003 at 04:41 PM.
    Using Visual Studio .NET 2005

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    195
    Turned out to be VS complaining about itself... Something about a symbol name getting too long for it to handle... I disabled it.
    Using Visual Studio .NET 2005

  5. #5
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985
    Originally posted by Barguast
    ... it says what compiler I'm using in the sig
    Display user sigs = off for me, they're annoying and pointless

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    VC++6 (and I think 7 too, but not 7.1) can only handle identifiers up to 255 characters in the debug information. If an identifier gets longer, it's truncated. Only for the debug information. This can cause problems if two identifiers are the same except in the last few characters.

    Since full names are used instead of typedefs, the harmless
    vector<string>
    suddenly becomes
    std::vector<class std::basic_string<char,struct std::char_traits<char>,cla
    ss std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >
    which then gets mangled to
    ??0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_stri ng@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@IABV?$basic_string@DU?$char_traits@D@s td@@V?$allocator@D@2@@1@ABV?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@ @@1@@Z
    which is longer than 255 characters.

    You can disregard the warning, you can even simply switch it off via directives or project options.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width