Dave's Brain

Browse - Programming Tips - When I use STL (Standard Template Library) in Visual Studio 6

Date: 2007nov22
Language: C++
Platform: Visual Studio 6

Q.  When I use STL (Standard Template Library) in Visual Studio 6
    I get hundreds of useless warnings.  Can I stop them?

Example warning:

c:\program files\microsoft visual studio\vc98\include\xtree(72) : warning C4786: 'std::_Tree<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >> const ,i nt>,std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int,ci_less,std::allocator<int> >::_Kfn,ci_less,std::allocator<int> >>::const_iterator::operator->' : identifier was truncated to '255' characters >>in the debug information
A. Yes, but only if you include the STL headers in your stdafx.h file. Add this at the end of the of that file:
#pragma warning(disable: 4786) // no big name warnings for STL #include <map> #include <vector> ... other STL headers ...

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.