Solved

STL map problem

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 100
AWS and JSON: Best JSON editor for creating CloudFormation Templates, etc. ? 3 110
C++ question 3 65
DCT of  2D array using fftw in c++ 9 41
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
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.

773 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