4.3. Setup the Software System - Visual Studio Import

This section describes how to create a new C++ system by importing a Visual Studio Solution file. Select "New""System based on C/C++ Visual Studio 2010 Solution file" . Specify the name of the directory of the Sonargraph system and where its files will be stored. It is a best practice to store the system close to the actual source code and place it under version control. Using a Quality Model is explained in Section 2.6, “Share Results” ; you can leave this option unchecked for now.

On the next wizard page, select the solution file to import and the configuration and platform combination.

Specify Visual Studio Solution File
Figure 4.1. Specify Visual Studio Solution File

If the system is refreshed and the active compiler definition does not match the imported solution, you might run into the following two problems which can both usually be fixed by selecting the correct compiler definition on the preference page as described in Section 4.7, “C/C++ Compiler Definitions” . In this case, the correct compiler definition is "VisualCpp_11.0_x86".

  1. MSBuild Exception: Sonargraph uses internally MSBuild to determine the source files to compile and the compiler options to be used. Usually, if MSBuild fails some built-in variable is not resolved correctly.

    MSBuild Exception
    Figure 4.2. MSBuild Exception

  2. Parse Error: The parsing is aborted if a header file cannot be found. Check the folder where the header file can be found on disk and select a compiler definition that contains this folder as part of its --sys_include options.

    Parse Error (Missing Header File)
    Figure 4.3. Parse Error (Missing Header File)