HOWTO: Get Info for Troubleshooting Compiler & Linker ProblemsLast reviewed: October 7, 1997Article ID: Q134650 |
The information in this article applies to:
SUMMARYWhen you investigate a possible problem with the Microsoft Visual C++ compiler or linker, it is important to obtain as much information as possible about the build process and the options being used. This article discusses some trouble-shooting tips to help you resolve your build problem.
MORE INFORMATION
Compiler ProblemsFor compiler problems, such as internal compiler errors (for example, C1001), hangs, or crashes, use the /P switch to obtain additional compiler information. The /P compiler switch directs CL.EXE to send preprocessor output to a file. The preprocessor output file (with an extension of .i) has the same name as the file being compiled and is created in the same directory. Note that the build will not continue past the preprocessor phase when using this switch. You can compile the preprocessor output file by itself outside of the context of a project. The file contains all of the header file code, macro replacement, and preprocessed compiler directive information needed for the compilation of that particular .C or .CPP source file. The resulting file will often be long and contain a large amount of white space. Alternatively, you can use the /EP and /E compiler switches, which direct CL.EXE to send preprocessor output to the standard output device.
Link ProblemsFor linker problems (LNKxxxx type errors), you can use the LINK_REPRO environment variable to reproduce the problem:
When LINK.EXE is invoked, it will copy everything it needs to link your project into the directory specified by the LINK_REPRO environment variable. Among the files copied will be your object files (*.OBJ), required library files (*.LIB), including Microsoft libraries, and a linker response file (LINK.RSP), so that LINK is no longer dependent on your project makefile. This feature is also available from the IDE if it has been run from an environment where the LINK_REPRO variable has been set. To confirm that you have all the necessary files to reproduce the link problem, you can run LINK in the directory specified by the LINK_REPRO environment variable, using the linker response file:
LINK @link.rspUse the following command to switch off this feature:
SET LINK_REPRO=You can also use the LINK_REPRO environment variable to verify the files involved in creating a library, when using LIB.EXE or LINK /LIB.
|
Additional query words: 9.0 9.00 9.1 9.10 9.2 9.20 2.55
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |