473,378 Members | 1,360 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

map and visual C++

#include<map>
#include<iostream>
#include<string>

using namespace std;

int main()
{

map <string,int> test;

test["hello"]=5;
test.insert(map<string,int>::value_type("bye",10)) ;

typedef map<string,int>::const_iterator CI;

for(CI p=test.begin();p!=test.end();++p)
cout<<p->first<<" "<<p->second<<endl;
return 0;
}

The above code gives around 100 warnings on compiling in Microsoft
Visual C++ compiler.Most of which don't make any sense to me.If any
one can throw some light on the warnings.I am also posting some sample
warnings.I have tried using vector container also but that doesn't
give any error.It's only when i use map that these warnings arise.
/****Warnings*****/
c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786: 'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
const , int>,std::map<std::basic_string<char,std::char_tra its<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int>::_Kfn,std::less<std::basic_string<char,std::char _traits<cha

r>,std::allocator<char> > >,std::allocator<int> >' : identifier was
truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46)
: see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>,std::pair<std::basic_string<char,std::char_trait s< char>,std::allocator<char> > const
,int>,std::map<std::basic_string<char,std::char_tr aits<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int> >::_Kfn,std::less<std::ba
sic_string<char,std::char_traits<char>,std::alloca tor<char> >,std::allocator<int> >' being compiled C:\Documents and Settings\Somesh Chandra\Desktop\Assembler\New
Folder\Cpp1.cpp(11) : see reference to class template instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>,int,std::less<std::basic_string <char,std::char_traits<char>,std::allocator<char > >,std::allocator<int> >' being compiled c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786: 'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
const , int>,std::map<std::basic_string<char,std::char_tra its<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int>::_Kfn,std::less<std::basic_string<char,std::char _traits<cha

r>,std::allocator<char> > >,std::allocator<int> >::const_iterator' :
identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46)
: see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>,std::pair<std::basic_string<char,std::char_trait s< char>,std::allocator<char> > const
,int>,std::map<std::basic_string<char,std::char_tr aits<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int> >::_Kfn,std::less<std::ba
sic_string<char,std::char_traits<char>,std::alloca tor<char> >,std::allocator<int> >' being compiled C:\Documents and Settings\Somesh Chandra\Desktop\Assembler\New
Folder\Cpp1.cpp(11) : see reference to class template instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>,int,std::less<std::basic_string <char,std::char_traits<char>,std::allocator<char > >,std::allocator<int> >' being compiled c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786: 'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
const , int>,std::map<std::basic_string<char,std::char_tra its<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int>::_Kfn,std::less<std::basic_string<char,std::char _traits<cha

r>,std::allocator<char> > >,std::allocator<int> >::iterator' :
identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46)
: see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>,std::pair<std::basic_string<char,std::char_trait s< char>,std::allocator<char> > const
,int>,std::map<std::basic_string<char,std::char_tr aits<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int> >::_Kfn,std::less<std::ba
sic_string<char,std::char_traits<char>,std::alloca tor<char> >,std::allocator<int> >' being compiled C:\Documents and Settings\Somesh Chandra\Desktop\Assembler\New
Folder\Cpp1.cpp(11) : see reference to class template instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>,int,std::less<std::basic_string <char,std::char_traits<char>,std::allocator<char > >,std::allocator<int> >' being compiled c:\program files\microsoft visual studio\vc98\include\xtree(120) :
warning C4786: 'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>,std::pair<std::basic_string<char,std::char_trait s<char>,std::allocator<char>
const , int>,std::map<std::basic_string<char,std::char_tra its<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int>::_Kfn,std::less<std::basic_string<char,std::char _traits<cha

r>,std::allocator<char> > >,std::allocator<int> >::_Node' : identifier
was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\map(46)
: see reference to class template instantiation
'std::_Tree<std::basic_string<char,std::char_trait s<char>,std::allocator<char>,std::pair<std::basic_string<char,std::char_trait s< char>,std::allocator<char> > const
,int>,std::map<std::basic_string<char,std::char_tr aits<char>,std::allocator<char>,int,std::less<std::basic_string<char,std::char_t raits<char>,std::allocator<char>
,std::allocator<int> >::_Kfn,std::less<std::ba
sic_string<char,std::char_traits<char>,std::alloca tor<char> >,std::allocator<int> >' being compiled C:\Documents and Settings\Somesh Chandra\Desktop\Assembler\New
Folder\Cpp1.cpp(11) : see reference to class template instantiation
'std::map<std::basic_string<char,std::char_traits< char>,std::allocator<char>,int,std::less<std::basic_string <char,std::char_traits<char>,std::allocator<char > >,std::allocator<int> >' being compiled


/****Warnings continued*******/

Thanks
Jul 23 '05 #1
5 2480
Somesh wrote:
#include<map>
#include<iostream>
#include<string>

using namespace std;

int main()
{

map <string,int> test;

test["hello"]=5;
test.insert(map<string,int>::value_type("bye",10)) ;

typedef map<string,int>::const_iterator CI;

for(CI p=test.begin();p!=test.end();++p)
cout<<p->first<<" "<<p->second<<endl;
return 0;
}

The above code gives around 100 warnings on compiling in Microsoft
Visual C++ compiler.Most of which don't make any sense to me.If any
one can throw some light on the warnings.[...]


Please ask compiler-specific questions in a newsgroup dedicated to that
compiler (in this case, microsoft.public.vc.language).

Warnings can be disabled. Warnings can be ignored. But one thing is
for sure, they are not part of the language.

V
Jul 23 '05 #2
ch************@gmail.com (Somesh) wrote in
news:40**************************@posting.google.c om:
#include<map>
#include<iostream>
#include<string>

using namespace std;

int main()
{

map <string,int> test;

test["hello"]=5;
test.insert(map<string,int>::value_type("bye",10)) ;

typedef map<string,int>::const_iterator CI;

for(CI p=test.begin();p!=test.end();++p)
cout<<p->first<<" "<<p->second<<endl;
return 0;
}

The above code gives around 100 warnings on compiling in Microsoft
Visual C++ compiler.Most of which don't make any sense to me.If any
one can throw some light on the warnings.I am also posting some sample
warnings.I have tried using vector container also but that doesn't
give any error.It's only when i use map that these warnings arise.
/****Warnings*****/
[snip]
/****Warnings continued*******/

Thanks


This has nothing to do with Standard C++, but is a Microsoft-specific
question. Go ask in a Microsoft-specific newsgroup.

Personally, I'd just disable the C4786 warning.

Jul 23 '05 #3
> The above code gives around 100 warnings on compiling in Microsoft
Visual C++ compiler.Most of which don't make any sense to me.If any


I got the same problem the first time I tried to use std::map too. I
have never been able to find a clean solution. It seems these warnings
are produced because VC6.0 internal class names are limited to 255
characters, but class names tend to be very long when using STL.
Solution:
either disable the warning with #pragma, it works,
either use another compiler. VC6.0 is really crappy when dealing with
templates. I recommend you to upgrade your compiler to VC7.1 which has a
far better support for templates and standard C++ in general.
-Fred
Jul 23 '05 #4
USE DEV C++ : OPEN SOURCE IS THE BEST

Jul 23 '05 #5
Somesh wrote:
#include<map>
#include<iostream>
#include<string>

using namespace std;

int main()
{

map <string,int> test;

test["hello"]=5;
test.insert(map<string,int>::value_type("bye",10)) ;

typedef map<string,int>::const_iterator CI;

for(CI p=test.begin();p!=test.end();++p)
cout<<p->first<<" "<<p->second<<endl;
return 0;
}

The above code gives around 100 warnings on compiling in Microsoft
Visual C++ compiler.Most of which don't make any sense to me.If any
one can throw some light on the warnings.I am also posting some sample
warnings.I have tried using vector container also but that doesn't
give any error.It's only when i use map that these warnings arise.
/****Warnings*****/ [snip] /****Warnings continued*******/

Thanks


Try microsoft.public.vstudio.general.

[OT] Or 1) compile in release mode, 2) type #pragma
warning(disable:4786) ..Visual Studio makes a file for debugging
purposes when you compile in debug mode that helps a debugger name
functions, variables, and objects correctly, and it only saves 255
characters, which is why you see some of those warnings[/OT]
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
0
by: gerd | last post by:
Hello, I want to port an MFC Application from Visual Studio 6 MFC application to Visual C++ 2005 express edition beta. While building i get following error: ------ Build started: Project:...
1
by: Daniel A. Thomas | last post by:
License required Maybe you don't have this but have one of the products that qualifies for the upgrade such as ... Visual Studio .NET 2003 Professional Visual Studio .NET 2003 Professional...
3
by: Edwin Smith | last post by:
I have a 2 form project in VS2005 that now hangs whenever I try to do anything with the second form. This seems to have started when I added some SQL tables from a Pervasive v.9 database using the...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
0
by: marathoner | last post by:
I am currently migrating my Visual C++ 6.0 applications to Visual Studio 2005. I am getting compiler errors involving the VS2005's platform SDK. When I removed directory references to that SDK,...
2
by: Cramer | last post by:
So, what is the relationship between Visual Studio and Visual Web Developer. I find a lot of documentation on MSDN that presents Visual Web Developer as it's own stand-alone product (which I'd...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
3
by: Johnson | last post by:
I'm not sure if this is an IIS 5.1 issue or ASP.NET issue, or Visual Studio 2008 issue -- thus posting to 3 groups. Please don't be offended. The problem I'm encountering is that Visual Studio...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.