Microsoft KB Archive/195386

= You may receive C4786 warnings when you try to build a project in Visual C++ 5.0 or in Visual C++ 6.0 =

Article ID: 195386

Article Last Modified on 6/2/2005

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q195386



SYMPTOMS
When building a project with Visual C++ 6.0 that compiles without a C4786 warning in Visual C++ 5.0, you may receive C4786 warnings, sometimes followed by:

Fatal Error C1033: cannot open program database 'vc60.pdb'.



RESOLUTION
In Visual C++ 5.0, using the following #pragma warning (disable : 4786) after including STL headers, disables the warning:

C4786:'identifier' : identifier was truncated to 'number' characters in the debug information.

However, this method does not disable all such warnings in Visual C++ version 6.0. The occurrence of many C4786 warnings may result in the following:

C1033 error: cannot open program database 'vc60.pdb'.

Use the pragma directive before you include any STL headers to disable the warnings.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
// compile options required: /Zi /GX #include #include #include

// move this pragma before the includes above to disable the //C4786 warnings #pragma warning (disable : 4786)

int main { using namespace std; map m;     m[0] = "hello world"; cout << m[0] << endl;

return 0; }

