Compiler ProblemsFor compiler problems, such as internal compiler errors (for example, C1001), hangs, or crashes, use the /P switch to obtain additional compiler information.
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:
- Open up an MS-DOS session.
- Set LINK_REPRO to point to an existing and empty directory, for example:SET LINK_REPRO=C:\TESTPROB
- Run the linker in the same MS-DOS session where the variable was set.
- Run the VCVARS32.BAT file from the Visual C++ BIN directory to set the compiler environment variables.
- Change to your project directory, and run NMAKE to rebuild your project, using this command:
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:
ID članka: 134650 – Zadnji pregled: 28. apr. 2005 – Revizija: 1