Microsoft KB Archive/102390

= INFO: Keeping #include Files Out of VWB Dependency List =

Article ID: 102390

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Visual C++ 1.0 Professional Edition
 * Microsoft Visual C++ 1.5 Professional Edition
 * Microsoft Visual C++ 1.52 Professional Edition
 * 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++ 4.1 Subscription
 * Microsoft Visual C++ 4.2 Professional Edition
 * Microsoft Visual C++ 5.0 Standard Edition

-



This article was previously published under Q102390







SUMMARY
By default, the Visual Workbench includes files in the dependency list even if they are included between an #ifdef, #endif pair. In some situations, this behavior may be undesirable. The following article describes several ways to keep the files out of the dependency scanning process.



MORE INFORMATION
The Visual Workbench scans a file for header file dependencies by looking for lines in a source file that have the form #include  -or- #include "filename.h" Because the dependency scanner does not have a preprocessor, it will include headers file in the dependency list even if they conditionally included using an #ifdef as shown below.

For example, with the following code, the file "unixstuf.h" will be tagged as a dependency when the makefile is built: #define _WIN32 #ifndef _WIN32 #include   #endif To get the desired behavior:

Add the file name to the Visual C++ system header exclusion file, SYSINCL.DAT, found in the product BIN directory. The SYSINCL.DAT file is used by the Visual Workbench to prevent scanning specified files for dependencies. In its initial state, SYSINCL.DAT lists the system include files that are unlikely to change. You can edit this file to prevent the Visual Workbench from scanning other files, such as header files that you know will not change, or to scan system files that you alter. If you delete the SYSINCL.DAT file, Visual Workbench restores it to its default state the next time you start Visual Workbench.

For Visual C++ 32-bit Edition, you have the option of creating MSVCINCL.DAT in the Windows NT directory. As the Visual C++ 4.0 Books Online state in the entry for "Updating Dependencies":

You can list in [MSVCINCL.DAT] additional files that you want to exclude, such as headers for external class libraries or some of the include files in a large project. You should use this file for additions because SYSINCL.DAT may be overwritten if you reinstall Visual C++, if you modify your installation with Setup, or if you update your installation. . . . These lists should contain only files that are not likely to change often.

Make any necessary changes to SYSINCL.DAT or MSVCINCL.DAT before you start the Visual Workbench.

