Skip to main content
GameDev.net gamedev.net
🔒 Locked

STL map problem

Started by zacharya Jan 28, 2004 at 7:15 PM 2 replies 1.1k views
Original Post
zacharya
zacharya
I just started learning about STL and I try to use to get the assosiative array feature but when I did I got lots of warning messages that I don''t understand.... here are the warning messages that the compiler generates --------------------Configuration: STL - Win32 Debug-------------------- Compiling... tes1.cpp D:\rz\visualcpp\STL\tes1.cpp(55) : warning C4786: ''std::reverse_bidirectional_iteratorair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::iterator,std:air,std:air &,std:air *,int>'' : identifier was truncated to ''255'' characters in the debug information D:\rz\visualcpp\STL\tes1.cpp(55) : warning C4786: ''std::reverse_bidirectional_iteratorair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::const_iterator,std:air,std:air const &,std:air const *,int>'' : identifier was truncated to ''255'' characters in the debug information D:\rz\visualcpp\STL\tes1.cpp(55) : warning C4786: ''std:airair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::iterator,std::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::iterator>'' : identifier was truncated to ''255'' characters in the debug information D:\rz\visualcpp\STL\tes1.cpp(55) : warning C4786: ''std:airair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::const_iterator,std::_Tr eeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::const_iterator>'' : identifier was truncated to ''255'' characters in the debug information c:\program files\microsoft visual studio\vc98\include\xtree(182) : warning C4786: ''std::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::~ _Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >'' : identifier was truncated to ''255'' characters in the debug information c:\program files\microsoft visual studio\vc98\include\xtree(162) : warning C4786: ''std::_Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::_ Treeair,std::map,std::allocator >::_Kfn,std::less,std::allocator >'' : identifier was truncated to ''255'' characters in the debug information c:\program files\microsoft visual studio\vc98\include\xtree(236) : warning C4786: ''__ehhandler$?insert@?$_Tree@PADU?$pair@QADPAD@std@@U_Kfn@?$map@PADPADU?$less@PAD@std@@V?$allocator@PAD@2@@2@U?$less@PAD@2@V?$allocator@PAD@2@@std@@QAE?AU?$pair@Vitera tor@?$_Tree@PADU?$pair@QADPAD@std@@U_Kfn@?$map@PADPADU?$less@PAD@std@@V?$allocator@PAD@2@@2@U?$less@PAD@2@V?$allocator@PAD@2@@std@@_N@2@ABU?$pair@QADPAD@2@@Z'' : identifier was truncated to ''255'' characters in the debug information c:\program files\microsoft visual studio\vc98\include\xtree(236) : warning C4786: ''__unwindfunclet$?insert@?$_Tree@PADU?$pair@QADPAD@std@@U_Kfn@?$map@PADPADU?$less@PAD@std@@V?$allocator@PAD@2@@2@U?$less@PAD@2@V?$allocator@PAD@2@@std@@QAE?AU?$pair@Vi terator@?$_Tree@PADU?$pair@QADPAD@std@@U_Kfn@?$map@PADPADU?$less@PAD@std@@V?$allocator@PAD@2@@2@U?$less@PAD@2@V?$allocator@PAD@2@@std@@_N@2@ABU?$pair@QADPAD@2@@Z$0'' : identifier was truncated to ''255'' characters in the debug information c:\program files\microsoft visual studio\vc98\include\utility(21) : warning C4786: ''std:airair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::iterator,bool>:airair,std::map,std::allocator >::_Kfn,std::less,std::allocator >::iterator,bool>'' : identifier was truncated to ''255'' c haracters in the debug information tes1.obj - 0 error(s), 9 warning(s) I''m using MS Visual C++ 6.0 as my compiler. Thanks before.
being young is a treasure that can''t be valued
TangentZ
TangentZ
It''s a known "feature" of MSVC6.

Add "#pragma warning(disable : 4786)"

at the top of the file to shut it up.



Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
zacharya
zacharya
When I run it I''m getting a run time error.

Here''s my code

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;

#pragma warning(disable : 4786)


int main(void)
{
/*
vector vec(5);

for(int i = 0; i < 5; i ++)
vec[ i ] = i;

for(i = 0; i < 5; i ++)
{
cout << vec[ i ] << " ";
}

cout << endl;


reverse(vec.begin(),vec.end());

vec.resize(6);
cout << vec.size() << endl;
vec[ 5 ] = 10;
for(i = 0; i < 6; i ++)
{
cout << vec[ i ] << " ";
}

cout << endl;

vector ::iterator p = find(vec.begin(),vec.end(),4);

cout << *p << endl;

*/

char names[3][5] = {"Rony","Gani","Leo"};

map ast;

ast["Rony"] = "03-2";
ast["Gani"] = "02-2";
ast["Leo"] = "02-1";

for(int i = 0; i < 3; i ++)
{
cout << ast[ names ] << endl;
}

return 1;
}
being young is a treasure that can''t be valued

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.