473,399 Members | 2,774 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,399 software developers and data experts.

Compiler (warning C4786:)

Okay, thanks to John (THANK YOU SO MUCH). I switched all my header files
over to using the new Standard <iostream> and included the using namespace
std; . This seems to have fixed all the errors I was getting because of
mixing the old and new headers. The problem I am running into now is not an
error but 10 warnings when compiling the same class header implimentation
file that I was working with when I was having the problems with the map
class(or so I thought). I get 10 warnings of type C4786. I looked up the
warning and got this.

---------------------------------------------------------------------------
--
Compiler Warning (level 1) C4786
'identifier' : identifier was truncated to 'number' characters in the debug
information

The identifier string exceeded the maximum allowable length and was
truncated.

The debugger cannot debug code with symbols longer than 255 characters. In
the debugger, you cannot view, evaluate, update, or watch the truncated
symbols.

----------------------------------------------------------------------------
---------------

The warning is pointing here in the implimentation file (only the beginning
snippet not the full file for sake of space)
(<--*) Points to line indicated by debugger

----------------------------------------------------------------------------
---------------
// SkillList.cpp: implementation of the SkillList class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "SkillList.h"
/////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

SkillList::SkillList()
{

} (<--*)

SkillList::~SkillList()
{

}
//////////////////////////////////////////////////////////////////////
// Overloaded Operators
//////////////////////////////////////////////////////////////////////

ostream& operator<< (ostream& os, const Skill& skill)
{
os << skill.GetName() << ":\t" << skill.GetSLevel() << endl;
return os;
}
----------------------------------------------------------------------------
--------------
I can't seem to figure out why this warning is getting sent to an end brace.
The Class member function seems to be declared right and there are no other
identifiers afterwards which the debugger could be misreading. I think there
must be something being read wrong earlier as I have no identifiers nearly
as large as the max of 255. The other strange thing is that not all of the
warnings are for my code but a few point to code in a "xtree" and "utility"
file which I assume to be part of a standard header I am using. I'll list a
full warning of each type.. one that points to my code and one that points
to code in a "xtree" file.

-Warning pointing to the line indicated in implimantion file-

C:\Program Files\Microsoft Visual
Studio\MyProjects\GameProject\SkillList.cpp(16) : warning C4786:
'std::reverse_bidirectional_iterator<std::_Tree<in t,std::pair<int const
,Skill>,std::map<int,Skill,std::less<int>,std::all ocator<Skill>
::_Kfn,std::l ess<int>,std::allocator<Skill> >::iterator,std::pair<int const
,Skill>,std::pair<int const ,Skill> &,std::pair<int const ,Skill> *,int>' :
identifier was truncated to '255' characters in the debug information

-Warning pointing to a line indicated in a "xtree" file-

c:\program files\microsoft visual studio\vc98\include\xtree(174) : warning
C4786: 'std::_Tree<int,std::pair<int const
,Skill>,std::map<int,Skill,std::less<int>,std::all ocator<Skill>::_Kfn,std::less<int>,std::allocator<Skill> >::_Tree<int,std::pair <int const ,Skill>,std::map<int,Skill,std::less<int>,std::all ocator<Skill>::_Kfn,std::less<int>,std::allocator<Skill> >' : identifier was truncated

to '255' characters in the debug information
Any help at all would again be most appreciated. Thank you for your patience
with this confused youngster.

Jason

ps I've included below the interface header file which is included in the
implimentation file in the off chance that the problem may be found there;

----------------------------------------------------------------------------
---------------------------------
// SkillList.h: interface for the SkillList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SKILLLIST_H)
#define AFX_SKILLLIST_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Skill.h"
#include "String.h"

using namespace std;

// Map SkillMap defined to contain an int key and a Skill as its data
typedef map<int, Skill> SkillMap;

class SkillList
{
public:

SkillList();
virtual ~SkillList();

SkillMap GetList() const;
void SetSkillnList( Skill );
void ShowList() const;

friend ostream& operator<< (ostream& os, Skill& skill);

protected:
SkillMap itsSkillMap;

};

#endif // !defined(AFX_SKILLLIST_H)
----------------------------------------------------------------------------
------------------------------------------------
Jul 22 '05 #1
4 1899

"thule" <th***@bresnan.net> wrote in message
news:G6Tac.54277$JO3.35171@attbi_s04...
Okay, thanks to John (THANK YOU SO MUCH). I switched all my header files
over to using the new Standard <iostream> and included the using namespace
std; . This seems to have fixed all the errors I was getting because of
mixing the old and new headers. The problem I am running into now is not an
error but 10 warnings when compiling the same class header implimentation
file that I was working with when I was having the problems with the map
class(or so I thought). I get 10 warnings of type C4786. I looked up the
warning and got this.

---------------------------------------------------------------------------
--
Compiler Warning (level 1) C4786
'identifier' : identifier was truncated to 'number' characters in the debug
information


Read this -
http://www.codeguru.com/forum/showth...hreadid=232164

-Sharad
Jul 22 '05 #2
On Thu, 01 Apr 2004 11:33:58 GMT, "thule" <th***@bresnan.net> wrote:
Okay, thanks to John (THANK YOU SO MUCH). I switched all my header files
over to using the new Standard <iostream> and included the using namespace
std; . This seems to have fixed all the errors I was getting because of
mixing the old and new headers. The problem I am running into now is not an
error but 10 warnings when compiling the same class header implimentation
file that I was working with when I was having the problems with the map
class(or so I thought). I get 10 warnings of type C4786. I looked up the
warning and got this.

---------------------------------------------------------------------------


How many readers of this group have been laying odds I'd be the one to
respond to this? :-)

C4786 warnings are a long-standing VC6 problem, because they seldom
contribute useful information. There's just some internal symbol length
warning that gets triggered by expanded template type names. There's a
pragma that's supposed to work to turn them off, but there are some
ordering issues and I'm not sure I've yet seen a 100%-sure fire way to deal
with them from the compiler angle.

So consider using STLFilt, which makes them all go away automatically
(along with the trailing fragmentary messages that often follow them, or
what I refer to as their "detritus")
-leor

--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
Jul 22 '05 #3
>
Read this -
http://www.codeguru.com/forum/showth...hreadid=232164

-Sharad


Well what do you know, another C++ FAQ! There's some good stuff in there, I
much prefer the style to our existing FAQ, and frankly the questions seem to
be much more frequently asked than some of the obscure topics in the
official FAQ.

Could do with some organising however, and I spotted the odd inaccuracy, but
I'll remember it for future use.

john
Jul 22 '05 #4

"John Harrison" <jo*************@hotmail.com> wrote in message
news:c4*************@ID-196037.news.uni-berlin.de...
Well what do you know, another C++ FAQ! There's some good stuff in there, I
much prefer the style to our existing FAQ, and frankly the questions seem to
be much more frequently asked than some of the obscure topics in the
official FAQ.
Yes, the FAQ is more like day to day problems which people face.
Could do with some organising however, and I spotted the odd inaccuracy, but
I'll remember it for future use.


:-)

-Sharad
Jul 22 '05 #5

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

Similar topics

10
by: Sony Antony | last post by:
I have the following simple program in Solaris Forte compiler 5.4 producing the warning. Though it produces the warning, it works fine as expected. This has been compiling fine without any...
1
by: rob | last post by:
Hey, I'm getting an error message (C4786) while compiling some code that contains a vector of strings "vector <string> myVector(4);" i've added "#pragma warning(disable:4786)" to the...
4
by: thule | last post by:
Okay, thanks to John (THANK YOU SO MUCH). I switched all my header files over to using the new Standard <iostream> and included the using namespace std; . This seems to have fixed all the errors I...
1
by: Hafeez | last post by:
I am having real trouble compiling this code http://www.cs.wisc.edu/~vganti/birchcode/codeHier/AttrProj.tgz The attachment shows errors when compiled using the current version of g++ in a...
5
by: Jason Heyes | last post by:
This debugger-related warning is flooding my output window. Example: c:\program files\microsoft visual studio\vc98\include\xmemory(38) : warning C4786:...
29
by: junky_fellow | last post by:
Consider the following piece of code: struct junk { int i_val; int i_val1; char c_val; }; int main(void) {
34
by: Bob | last post by:
Hi, The compiler gives Warning 96 Variable 'cmdSource' is used before it has been assigned a value. A null reference exception could result at runtime. Dim cmdSource as SQlClient.SQLDataReader...
8
by: Charles Sullivan | last post by:
I have a program written in C under Linux (gcc) which a user has ported to run under AT&T SysV R4. He sent me a copy of his makelog which displays a large number of compiler warnings similar to...
11
by: zeppe | last post by:
Hi all, I've a problem. The code that follows creates a warning in both gcc and visual c++. However, I think it's correct: basically, there is a function that return an object of a derived...
3
by: gil | last post by:
Hi, I'm trying to find the best way to work with compiler warnings. I'd like to remove *all* warnings from the code, and playing around with the warning level, I've noticed that compiling with...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.