Archived

This topic is now archived and is closed to further replies.

How to avoid C4786 warning with precompiled headers

This topic is 5377 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

We have a project going on where we just started using precompiled headers, and we get a problem that we cannot get rid of the C4786 warning (using MSVC 6.0). Normaly we just #pragma warning(disable:4786) clause in our header files. This does not seem to work when using precompiled headers though. Any sugestions on how to remove these warnings? Utopico

Share this post


Link to post
Share on other sites
The description of Warning C4786 is "... identifier was truncated to ''255'' characters in the debug information."

To get rid of the warning when using PCH we place the "#pragma warning (disable:4786)" in stdafx.h, or whatever header you use to create the PCH, before any of the STL headers are included.

- Tim

Share this post


Link to post
Share on other sites
Up to VC++ 6 there is a bug preventing C4786 from being disabled via pragma:

http://support.microsoft.com/default.aspx?scid=KB;en-us;q167355

There is a work around at flipcode.com:

http://www.flipcode.com/cgi-bin/msg.cgi?showThread=00001780&forum=general&id=-1

- Andre

Share this post


Link to post
Share on other sites