Microsoft KB Archive/68835

= PRB: Compiler Prints Filename But Does Not Compile the Program =

Article ID: 68835

Article Last Modified on 7/5/2005

-

APPLIES TO


 * Microsoft C Professional Development System 6.0a
 * Microsoft Visual C++ 1.0 Professional Edition
 * Microsoft Visual C++ 1.5 Professional Edition
 * Microsoft Visual C++ 1.51
 * Microsoft Visual C++ 1.0 Professional Edition
 * Microsoft Visual C++ 2.0 Professional Edition
 * Microsoft Visual C++ 2.1
 * Microsoft Visual C++ 4.0 Standard Edition
 * Microsoft Visual C++ 5.0 Standard Edition

-



This article was previously published under Q68835





SYMPTOMS
Using the Microsoft C/C++ compiler, if your program prints out your filename after you type in the following:   cl filename.c and then returns to the command prompt without creating an executable file, there may be duplicate compiler filenames. Within the Programmer's WorkBench (PWB) or Visual Workbench (VWB), it will indicate that there are no warnings or errors after rebuilding, but the compiler will not create an executable file.



CAUSE
The C compiler is a three-pass compiler, and invokes the files C1.EXE, C2.EXE, and C3.EXE for C versions 5.1, 6.0, 6.0a, and 6.0ax. To determine what files are being invoked for C/C++ 7.0 and Visual C++ 1.0, add the /d compiler switch to the command line; for Visual C++ 2.xx and above, add the /Bd switch. Different files will be used depending on whether it is a C or C++ source file.

If there are any other files with these names on the path before the compiler, then the compiler may incorrectly execute the wrong file.



RESOLUTION
There is a compiler switch, /d or /Bd, that will enable you to print out which files are being invoked during each pass of the compiler. Use this to determine if the wrong files are being called by the compiler.   cl /d filename.c

-or-

  cl /Bd filename.c

Keywords: kbvc152fix kbprb kbcompiler KB68835

-

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

© Microsoft Corporation. All rights reserved.