Link to home
Start Free TrialLog in
Avatar of felonius
felonius

asked on

STL map problem

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


ASKER CERTIFIED SOLUTION
Avatar of nietod
nietod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nietod
nietod

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.
Avatar of felonius

ASKER

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
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.
OK, thanks for your help. I will do that.