By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,631 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

Compiler (warning C4786:)

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a

"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

P: n/a
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

P: n/a
>
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

P: n/a

"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 discussion thread is closed

Replies have been disabled for this discussion.