Solved

STL map problem

Posted on 1998-11-29
5
184 Views
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?

felonius


0
Comment
Question by:felonius
  • 3
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
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.
0
 
LVL 22

Expert Comment

by:nietod
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.
0
 
LVL 1

Author Comment

by:felonius
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.

felonius
0
 
LVL 22

Expert Comment

by:nietod
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.
0
 
LVL 1

Author Comment

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


0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

759 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

20 Experts available now in Live!

Get 1:1 Help Now