Microsoft KB Archive/121889

= PRB: Error C2858: Command-line Options Inconsistent =

Article ID: 121889

Article Last Modified on 7/5/2005

-

APPLIES TO


 * Microsoft Visual C++ 1.0 Professional Edition
 * Microsoft Visual C++ 2.0 Professional Edition
 * Microsoft Visual C++ 4.0 Standard Edition
 * Microsoft Visual C++ 5.0 Standard Edition
 * Microsoft Visual C++ 6.0 Service Pack 5

-



This article was previously published under Q121889



SYMPTOMS
When building a file from an existing application that uses precompiled header files, the compiler produces the following error if the source drive letter has changed:   error C2858: command-line option 'program database name (/FdN:\test.pdb)' inconsistent with precompiled header, which used '/FdM:\test.pdb'



CAUSE
The compiler stores and uses an absolute path to the precompiled header file, not a relative path.



RESOLUTION
Microsoft recommends that you rebuild an application when moving its source code or when connecting with a different drive letter.



MORE INFORMATION
The following sample code demonstrates the behavior. If the two files shown below are compiled from the M: drive and later TEST2.CPP is compiled from the N: drive, the error will occur.

Sample Code
/* Compile options needed: /Zi /Fp"test.pch" /Yc TEST1.CPP


 * 1) include 

void main { }

/* Compile options needed: /Zi /Fp"test.pch" /Yu"iostream.h"  TEST2.CPP


 * 1) include 

void sub { }

Additional query words: 9.00

Keywords: kbprb kbcpponly kbcompiler KB121889

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.