Solved

STL map problem

Posted on 1998-11-29
5
188 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Embarcadero C++ Builder XE2 TDateTime 8 75
Change local server setting in php 6 94
What is the Best Editor for PHP Development ? 5 79
Android development question 2 53
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

809 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