Command line options

The GUI can be started from a terminal or a shortcut with options:

cppcheck-gui [OPTIONS] [files or paths]
OptionDescription
-p <file>Open the project file and analyze it. If the project has a build dir with earlier results, these are shown instead; click Reanalyze all files to analyze again.
-l <file>Open a results file in XML format.
-d <directory>Used with -l: the folder that was analyzed to create the results file. Relative paths in the results file are relative to this folder. It is needed to show the source code of the warnings.
-h, --helpShow a short description of the options.
-v, --versionShow the version of the GUI.
--data-dir=<directory>Meant for installation scripts. Stores the folder where Cppcheck's data files (translations, library configurations, platforms, addons) are installed. The GUI is not started when this option is used.
files or pathsAnalyze these files and folders without a project. If one of the arguments is a project file (*.cppcheck), it is opened as with -p. If one of them is an XML file, it is opened as a results file.

Examples

Open a project:

cppcheck-gui -p myproject.cppcheck

or simply:

cppcheck-gui myproject.cppcheck

Look at the results of a CI job. The job ran Cppcheck in the folder /home/me/src/myproject and saved the results:

cppcheck-gui -l results.xml -d /home/me/src/myproject

Analyze a folder without a project:

cppcheck-gui src/

Starting without options

When the GUI is started without options, it opens the project that was open when it was closed last time, and shows the results of the last analysis if the project has a build dir.