473,748 Members | 4,067 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

map and visual C++

#include<map>
#include<iostre am>
#include<string >

using namespace std;

int main()
{

map <string,int> test;

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

typedef map<string,int> ::const_iterato r 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\inc lude\xtree(120) :
warning C4786: 'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>
,std::pair<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>
const , int>,std::map<s td::basic_strin g<char,std::cha r_traits<char>, std::allocator< char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int>::_Kfn,std::le ss<std::basic_s tring<char,std: :char_traits<ch a

r>,std::allocat or<char> > >,std::allocato r<int> >' : identifier was
truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\inc lude\map(46)
: see reference to class template instantiation
'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>,std::pair<std ::basic_string< char,std::char_ traits< char>,std::allo cator<char> > const
,int>,std::map< std::basic_stri ng<char,std::ch ar_traits<char> ,std::allocator <char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int> >::_Kfn,std::le ss<std::ba
sic_string<char ,std::char_trai ts<char>,std::a llocator<char> >,std::allocato r<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<ch ar,std::char_tr aits<char>,std: :allocator<char >,int,std::less <std::basic_str ing <char,std::char _traits<char>,s td::allocator<c har> >,std::allocato r<int> >' being compiled c:\program files\microsoft visual studio\vc98\inc lude\xtree(120) :
warning C4786: 'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>,std::pair<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>
const , int>,std::map<s td::basic_strin g<char,std::cha r_traits<char>, std::allocator< char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int>::_Kfn,std::le ss<std::basic_s tring<char,std: :char_traits<ch a

r>,std::allocat or<char> > >,std::allocato r<int> >::const_iterat or' :
identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\inc lude\map(46)
: see reference to class template instantiation
'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>,std::pair<std ::basic_string< char,std::char_ traits< char>,std::allo cator<char> > const
,int>,std::map< std::basic_stri ng<char,std::ch ar_traits<char> ,std::allocator <char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int> >::_Kfn,std::le ss<std::ba
sic_string<char ,std::char_trai ts<char>,std::a llocator<char> >,std::allocato r<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<ch ar,std::char_tr aits<char>,std: :allocator<char >,int,std::less <std::basic_str ing <char,std::char _traits<char>,s td::allocator<c har> >,std::allocato r<int> >' being compiled c:\program files\microsoft visual studio\vc98\inc lude\xtree(120) :
warning C4786: 'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>,std::pair<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>
const , int>,std::map<s td::basic_strin g<char,std::cha r_traits<char>, std::allocator< char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int>::_Kfn,std::le ss<std::basic_s tring<char,std: :char_traits<ch a

r>,std::allocat or<char> > >,std::allocato r<int> >::iterator' :
identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\inc lude\map(46)
: see reference to class template instantiation
'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>,std::pair<std ::basic_string< char,std::char_ traits< char>,std::allo cator<char> > const
,int>,std::map< std::basic_stri ng<char,std::ch ar_traits<char> ,std::allocator <char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int> >::_Kfn,std::le ss<std::ba
sic_string<char ,std::char_trai ts<char>,std::a llocator<char> >,std::allocato r<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<ch ar,std::char_tr aits<char>,std: :allocator<char >,int,std::less <std::basic_str ing <char,std::char _traits<char>,s td::allocator<c har> >,std::allocato r<int> >' being compiled c:\program files\microsoft visual studio\vc98\inc lude\xtree(120) :
warning C4786: 'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>,std::pair<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>
const , int>,std::map<s td::basic_strin g<char,std::cha r_traits<char>, std::allocator< char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int>::_Kfn,std::le ss<std::basic_s tring<char,std: :char_traits<ch a

r>,std::allocat or<char> > >,std::allocato r<int> >::_Node' : identifier
was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\inc lude\map(46)
: see reference to class template instantiation
'std::_Tree<std ::basic_string< char,std::char_ traits<char>,st d::allocator<ch ar>,std::pair<std ::basic_string< char,std::char_ traits< char>,std::allo cator<char> > const
,int>,std::map< std::basic_stri ng<char,std::ch ar_traits<char> ,std::allocator <char>,int,std::less <std::basic_str ing<char,std::c har_traits<char >,std::allocato r<char>
,std::allocato r<int> >::_Kfn,std::le ss<std::ba
sic_string<char ,std::char_trai ts<char>,std::a llocator<char> >,std::allocato r<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<ch ar,std::char_tr aits<char>,std: :allocator<char >,int,std::less <std::basic_str ing <char,std::char _traits<char>,s td::allocator<c har> >,std::allocato r<int> >' being compiled


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

Thanks
Jul 23 '05 #1
5 2510
Somesh wrote:
#include<map>
#include<iostre am>
#include<string >

using namespace std;

int main()
{

map <string,int> test;

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

typedef map<string,int> ::const_iterato r 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.publi c.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.goo gle.com:
#include<map>
#include<iostre am>
#include<string >

using namespace std;

int main()
{

map <string,int> test;

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

typedef map<string,int> ::const_iterato r 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<iostre am>
#include<string >

using namespace std;

int main()
{

map <string,int> test;

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

typedef map<string,int> ::const_iterato r 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.publi c.vstudio.gener al.

[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
6176
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 itself. Everything you need is available at no costs (except download hassle and installation time). Once your system is set up properly its just a matter of running 'python setup.py build'. No longer waiting for someone else to build binaries and a...
0
6135
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 file as folows. I need help to resolve them ASAP: cl /c /nologo /MDd /W3 /Od /GR /GM /Zi /GX /D "_DEBUG" /D " WIN32" /D "_W INDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /
0
2594
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: OSTDLL, Configuration: Debug Win32 ------ Compiling... StdAfx.cpp
1
2542
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 Special Edition Visual Studio .NET 2003 Enterprise Architect Visual Studio .NET 2003 Enterprise Developer Visual Studio .NET 2002 Professional Edition
3
6061
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 Pervasive ODBC driver. The devenv.exe process hangs and will not respond with about 50% cpu usage and about 100 megs of memory used. I am running it on an Athlon 64 bit dual core with 32 bit Windows XP pro. I have 2 megs of memory so I don't...
1
3601
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 some files and work on it. Let say, I want add new page to web project named websiteOrder.sln, i will open websiteOrder.sln in my local computer, connected to websiteOrder.sln located in Visual Source Safe 6.0(source safe located in another...
0
6680
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, and started using the Microsoft Platform SDK for XP SP2, the errors disappeared, but I am now getting numerous warnings (macro redefinitions) as follows: StdAfx.cpp WINVER not defined. Defaulting to 0x0502 (Windows Server 2003) C:\Program...
2
3400
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 expect of the Express editions), but apparently there are NON Express versions of Visual Web Developer. Is Visual Web Developer only built-in to Visual Studio 2008 Professional? I see "Microsoft Visual Web Developer 2008" listed as an installed...
0
7334
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 beginning CIS student who is struggling to get their programs working. I work in the computer lab at the college I'm attending and I see many students who don't know how to use the IDE for best results. Visual Studio automatically creates a number of...
3
10512
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 closes unexpectedly and without any error message being displayed, or error messages written to the system logs. Visual Studio closes when I attempt to open an ASP.NET Web application (not Web site) solution for which IIS is set as the project's...
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9544
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4606
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.