Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stupid error message

Status
Not open for further replies.

timmay3141

Programmer
Joined
Dec 3, 2002
Messages
468
Location
US
I'm getting a warning I get that is really annoying:

c:\program files\microsoft visual studio\vc98\include\vector(48) : warning C4786: '??0?$vector@V?$vector@VCBlock@@V?$allocator@VCBlock@@@std@@@std@@V?$allocator@V?$vector@VCBlock@@V?$allocator@VCBlock@@@std@@@std@@@2@@std@@QAE@IABV?$vector@VCBlock@@
V?$allocator@VCBlock@@@std@@@1@ABV?$allocator@V?$vector@VCBlock@@V?$allocator@VCBlock@@@std@@@std@@@1@@Z' : identifier was truncated to '255' characters in the browser information
c:\documents and settings\user\my documents\c++ workspaces\image\blockmatrix.h(39) : see reference to class template instantiation 'std::vector<class std::vector<class CBlock,class std::allocator<class CBlock> >,class std::allocator<class st
d::vector<class CBlock,class std::allocator<class CBlock> > > >' being compiled

As you can see, its huge and annoying (I get it 8 times) - and all I do is #include <vector> declare a vector. I want to get rid of this worthless error message. How can I do this?
 
Add this line to your program
Code:
#pragma warning( disable: 4786 )
It suppresses that specific warning message

It depends how wide-spread your use of this particular vector is, but putting this pragma in blockmatrix.h seems like a good place to start.
 
&quot;Stupid error message&quot;
&quot;I'm getting a warning&quot;
&quot;I want to get rid of this worthless error message&quot;
As you realized(?) it is a warning, not an error. A warning you can safely ignore (though I agree it is quite annoying)

To disable the warning put a
#pragma warning (disable: 4768)
into your code.

However, there's a bug in VC, #pragma warning (disable: 4768) doesn't always work.

Sometimes I get it to work, mainly by testing (trial and error) where to put it, but sometimes I never get it to work at all.



/Per

if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
 
Yeah, I wrote this topic when i was having 2 different messages, 1 was an error. I got an idea about the error message (the message was worded badly and confused me), but I fixed it, and erased it from the post, but forgot to change the title to warning instead of error. Anyway, thanks for the suggestion both of you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top