Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. STL map warning messages

STL map warning messages

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpcsslampvisual-studio
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arun Saha
    wrote on last edited by
    #1

    I wrote the following code in my app. It works fine but a bunch of warning messages are bugging the hell out of me. All the books that I consulted declare map like this. Any help to get rid of these obnoxious warnings is much appreciated. Thanks. class Product { ........ } int main() { Product Pen("Pen", 5.99, 58); Product Lamp("Lamp", 28.49, 24); Product Speaker("Speaker", 24.95, 40); map productMap; productMap[Pen.getName()] = Pen; productMap[Lamp.getName()] = Lamp; productMap[Speaker.getName()] = Speaker; return 0; } The WARNING messages -------------------- c:\program files\microsoft visual studio\vc98\include\xtree(118) : warning C4786: 'std::_Tree,std::allocator >,std::pair,std::allocator > const , Product>,std::map,std::allocator >,Product,std::less,std::allocator > >,std::allocator >::_Kfn,std::less,std::allocator > >,std::allocator >' : identifier was truncated to '255' characters in the debug information c:\program files\microsoft visual studio\vc98\include\map(46) : see reference to class template instantiation 'std::_Tree,std::allocator >,std::pair,std::allocator > const ,Product>,std::map,std::allocator >,Product,std::less,std::allocator > >,std::allocator >::_Kfn,std:: less,std::allocator > >,std::allocator >' being compiled C:\C++ Practice\map\map14.cpp(50) : see reference to class template instantiation 'std::map,std::allocator >,Product,std::less,std::allocator > >,std::allocator >' being compiled:mad:

    M 1 Reply Last reply
    0
    • A Arun Saha

      I wrote the following code in my app. It works fine but a bunch of warning messages are bugging the hell out of me. All the books that I consulted declare map like this. Any help to get rid of these obnoxious warnings is much appreciated. Thanks. class Product { ........ } int main() { Product Pen("Pen", 5.99, 58); Product Lamp("Lamp", 28.49, 24); Product Speaker("Speaker", 24.95, 40); map productMap; productMap[Pen.getName()] = Pen; productMap[Lamp.getName()] = Lamp; productMap[Speaker.getName()] = Speaker; return 0; } The WARNING messages -------------------- c:\program files\microsoft visual studio\vc98\include\xtree(118) : warning C4786: 'std::_Tree,std::allocator >,std::pair,std::allocator > const , Product>,std::map,std::allocator >,Product,std::less,std::allocator > >,std::allocator >::_Kfn,std::less,std::allocator > >,std::allocator >' : identifier was truncated to '255' characters in the debug information c:\program files\microsoft visual studio\vc98\include\map(46) : see reference to class template instantiation 'std::_Tree,std::allocator >,std::pair,std::allocator > const ,Product>,std::map,std::allocator >,Product,std::less,std::allocator > >,std::allocator >::_Kfn,std:: less,std::allocator > >,std::allocator >' being compiled C:\C++ Practice\map\map14.cpp(50) : see reference to class template instantiation 'std::map,std::allocator >,Product,std::less,std::allocator > >,std::allocator >' being compiled:mad:

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      The warning about >255 identifiers is a known problem with STL. You can safely ignore or disable that warning. --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.

      A 1 Reply Last reply
      0
      • M Michael Dunn

        The warning about >255 identifiers is a known problem with STL. You can safely ignore or disable that warning. --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.

        A Offline
        A Offline
        AHa
        wrote on last edited by
        #3

        how can you disable that? I got a same error with this code: #include #include #include #include using namespace std; int main() { deque lines; return 0; }

        M 1 Reply Last reply
        0
        • A AHa

          how can you disable that? I got a same error with this code: #include #include #include #include using namespace std; int main() { deque lines; return 0; }

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          #pragma warning(disable:4786) --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups