The information in this article applies to:
SYMPTOMSUnless a symbol is referenced in a program, it will not appear in the browser database. CAUSE
This problem is due to the default behaviors of the Compiler (CL.EXE)
and how it handles browser files (.SBR files), as well as the Browser
Database Maintenance Utility (BSCMAKE.EXE) and how it handles browser
databases (.BSC files).
RESOLUTIONBy understanding the default behaviors, you can discover where unreferenced symbols are defined. The default behavior of the Compiler when using the /FR or /Fr switches is to pack browser files, removing information about where unreferenced symbols are defined. To prevent the Compiler from doing this packing, use the /Zn switch from the command line, or check the "Don't Pack Information" checkbox under:
Similarly, the default behavior of BSCMAKE is to not record information
about unreferenced symbols when building the browser database for an
application. To turn off this behavior, use the /Iu switch from the command
line.
NOTE: There is no way to control BSCMAKE's behavior when using a Visual Workbench-generated makefile. The hard-coded default BSCMAKE command line used by the Visual Workbench doesn't include the /Iu option. In the case of a Visual Workbench-generated makefile, find the inference rule within the makefile generated by the Visual Workbench that causes the BSCMAKE utility to be executed. There, change the command line that is passed to the BSCMAKE utility. To do this, open the makefile as a text file and find the $(PROJ).BSC: inference rule. You should see the BSCMAKE command on the next line or two. Just add the /Iu option as shown in this example:
NOTE: There is an important caveat here. When you use the internal build
engine of the Visual Workbench, the inference rule portion of the makefile
is not used. Instead, the Visual Workbench uses the inference rules only
when the file is opened as an external makefile. For this solution to work,
the makefile must be opened as an external makefile in the Visual Workbench
or the project must be built with NMAKE from the command line.
NOTE: The Compiler and BSCMAKE work independently. BSCMAKE builds the browser database from browser (.SBR) files generated at compile time. Unreferenced symbols will not appear in the browser database if:
MORE INFORMATIONAn unreferenced symbol is a symbol that has been defined, but never appears in the body of code apart from its definition. Common examples of defined but unreferenced symbols are instances of CWinApp-derived classes in MFC applications and variables of any type that are not used in an application. Additional query words: 1.00 1.50 1.51
Keywords : TlsMisc |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |