computer motherboard

Static Linking

This tutorial describes how to setup C++ Bug Validator to include or exclude different source files from instrumentation processing when you are statically linking your application with MFC and/or the C Runtime.

When you statically link to MFC and/or the CRT, the code for the MFC and/or CRT libraries is included in your application. This means that C++ Bug Validator’s filtering by DLL policy will not work, as DLLs are not used to provide MFC and/or CRT support for statically linked applications.

This means that C++ Bug Validator needs to know where the source code for your application, source code for 3rd parties (MFC, CRT, etc) and any other source code is kept.

 

  • Open the settings dialog by clicking the tools icon on the toolbar.
    Bug Validator settings icon
  • The Settings Dialog is displayed. Select the File Locations tab.

    Bug Validator source file locations

    Bug Validator source file locations

  • Set the Path Type to “Source Files” and using the Partial Scan… button select the file paths that identify the locations of your application’s source code. The image shows one directory for an example statically linked application.
  • Set the Path Type to “Third Party Source Files” and using the Partial Scan… button select the file paths that identify the locations of your application’s 3rd party source code (MFC, CRT, 3rd party vendor controls, etc).
    Bug Validator 3rd party source file locations
    The image shows the directories for a typical Visual Studio 6.0 installation.
  • Select the Hook Insertion tab.
    Bug Validator hook insertion
  • Select the check boxes in the section marked Source Code Line Hook Insertion. The image shows that 3rd party source code has been marked to be ignored (deselected). Click OK to accept the settings.

Fully functional, free for 30 days