Imagix 4D User Guide


Step 2 - Import from Microsoft Visual Studio Approach

If you have Microsoft Visual Studio (MSVC) projects/solutions already defined for your software, the easiest way to for specifying your source code and how to analyze it is to reuse those definitions. The Microsoft Visual Studio approach extracts the file and preprocessor flag information directly from the makefile, .dsp, .vcproj or .vcxproj file created by Visual Studio. For solutions (called workspaces prior to the .NET version), .dsw or .sln files are read.

2a. Specify that you're adding a new data source

Open the Data Sources dialog (Project > Data Sources). To specify that you wish to add a new data source into the project rather than modify the settings for an existing data source, choose `+ new data source' under the Data Sources selector on the left side of the dialog. As this is a new project, and there are no existing data sources to modify, this is indeed the only choice available.

2b. Select the MSVC project or MSVC solution-based approach

For the rest of step 2, you'll be working on the right side of the Data Sources dialog. At the top, in the menubutton labeled `Select Data Source Type', select one of the [Source Files][Microsoft Visual Studio] alternatives. Use MSVC Project to load in the files associated with one specific project. Use MSVC Solution / Workspace if you want to load in the whole solution (called a workspace in older versions of Visual Studio).

2c. Specify the version of MSVC being used

To the right of the Type field, specify which version of MSVC you are using. This selection causes other parts of the dialog to change, since the various versions of MSVC use different file types to store information about the project.

2d. Specify the location of your MSVC project / solution file

Imagix 4D will process a specific file type for information about your code. That file type will vary depending on your selections for Type (Project or Solution) and for MSVC Version.

For example, if you've selected MSVC Project and Visual Studio .NET, the associated file type is a .vcproj file. In the resulting .vcproj File field, enter the full path name of the .vcproj file generated for your project by MSVC. Typically, this is located in the top-level MSVC project directory, and is named project.vcproj.

For MSVC versions prior to version 5, the associated file type is a .mak makefile. Importing using a makefile requires the Microsoft nmake executable, and therefore this is only supported under Windows. In the Makefile field, enter the full path name of the makefile generated for your project by MSVC. Typically, this is located in the top-level MSVC project directory, and is named project.mak, where project is the name of your MSVC project.

Occasionally, the makefiles generated by MSVC contain an error that prevents them from running, and this shows up as an error when you try to use MSVC Project to import your data. If you run into a problem using the MSVC Project, you can test whether it is caused by an erroneous makefile by running "nmake -n -p -k -f project.mak" from a DOS window command line. If you get the same error message as you got when trying to use the MSVC Project approach, the problem is in the makefile. You can try to correct the makefile, or elect another approach.

2e. Specify any directories containing pre-compiled headers

When pre-compiled headers are used, information about the include directories containing the original header files, from which they are compiled, may not be available in the MSVC project settings. In this case, you need to explicitly specify these directories so that the Imagix 4D analyzer knows where to look for the header files.

In the Options field, enter the directory names using the -I (or -S) syntax `-Idirname' for each directory containing the header files. You may enter as many -I's as required. Do not put a space between the -I and the following directory name. Put a space between the name and the next -I.

2f. Specify which MSVC project configuration you want to examine

In the Configuration combobox, select the configuration of Visual Studio project that you want to build. Leaving the selection as (default) will result in the current configuration of the MSVC project to be analyzed whenever the Imagix 4D project's data is regenerated. This combobox is not available for solutions, where the current configuration is always used.

2g. Select your compiler configuration file

In the Compiler & Target combobox, select the compiler configuration file that you set up in step 1. Normally, this will be msvc_win. If you haven't yet configured the msvc_win.inc configuration file and you've installed Visual Studio and its system headers in non-default locations, strongly consider doing so now. The alternative is to use the default `msvc_win' and to explicitly specify the location of the MSVC system headers in the Options field, just as you did for any pre-compiled headers (step 2e).

2h. Start the analysis process

When you're ready to analyze your code, click Add Data Source at the bottom of the dialog.