4.1. Setup the Software System - Compiler Definitions

Sonargraph internally uses the C/C++ parser of EDG (Edison Design Group, www.edg.com). To successfully parse your code the parser must be able to emulate your real compiler. To do that we use the concept of compiler definitions. Such a definition contains information like where to find the implicit system include directories and a list of predefined macros. Sonargraph comes with a couple of ready to use compiler definitions, eg. the Visual C++ family, the GNU compiler family, CLang and a few others.

There is always one compiler definition that is considered to be active. This is the one that is used for parsing your code. After a successful parser run Sonargraph will remember the compiler definition used and automatically activate it the next time you open the same project. When you parse a project for the first time we will use the compiler definition that is currently activated. To check your available compiler definition and to make sure the right one is activated you can go to the C/C++ preference pages. From there you can manage the available compiler definitions, modify existing ones or even create new ones.

If there is no compiler definition for your compiler we recommend to use our compiler definition wizard to create one. You start the wizard by selecting "New...""Configuration / New Compiler Definition". If you have used our other tool Sotograph before you can import Sotograph compiler definitions directly in the first step of the wizard. Otherwise just follow the instructions of the wizard.

If the C/C++ parser finds issues, they will be recorded in the C/C++ parser log window. You can open the parser log by selecting "Windows""Show View - C/C++ Parser Log". Errors recorded there are usually not a problem for the quality of the analysis. In the worst case a dependency might be missing if the parser cannot properly resolve a symbol. If there are many problems in this view this could indicate a problem with your compiler definition. An parser run will only fail if there are too more than 1000 errors in a compilation unit or if referenced include files cannot be found.