STL map problem

Posted on 1998-11-29
Last Modified: 2013-12-14
In Microsoft Visual C++ 6.0 SP1 the map do not seem to be able to work.

If I try to allocate af map:
#include <map>
map<int,int> myvar;

then the compiler warns me that the symbol length is over 255 characters and will be truncated (and can therefore not be used in the debugger). The warning description says that I should use #defines to shorten the names, but this does not seem to be the right thing to do, as the names get VERY short and I risk having something else replaced by the defines. It is warning C4786.

Does anybody know how to get around this problem?


Question by:felonius
  • 3
  • 2
LVL 22

Accepted Solution

nietod earned 100 total points
ID: 1178806
Yes.  Ignore it.  This is a warning, not an error, and everyone gets it when using STL classes, especially maps.
LVL 22

Expert Comment

ID: 1178807
There is a pragma you can use to make the warning message dissapear.  Unfortunately, this doesn't work too well because the library (and the windows librarys especially) fool with these settings as well so even though you turn off the warnings, they get turned back on again.  Still it tends to reduce the number of times the warning appears.

Author Comment

ID: 1178808
But does ignoring the problem not raise problems during debugging? If that is the case I would rather prefer to use list<pair<int,int> > instead.

LVL 22

Expert Comment

ID: 1178809
I've never had problems debugging and I get the errors.  I suspect the truncated symbols are still unique (at least in all my experience) and thus the debugger can find what it needs.  If so, the posibilitiy exists that at sometime the trunctated symbols created might not be unique and the debugger would be unable to resolve symbols.  But I've never seen it happen.

Author Comment

ID: 1178810
OK, thanks for your help. I will do that.


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Would like to move button in a function 3 72
C++ Language error 28 189
Best free Visio Editor? 2 138
passing data from one form to another form in c++ 27 75
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now