STL map warning messages
-
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:
-
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:
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.
-
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.
-
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; }
#pragma warning(disable:4786) --Mike-- http://home.inreach.com/mdunn/ The Signature, back by popular demand: Buffy. Pajamas.