CppCheck Linux Installation

I needed to install a static analysis framework in a linux environment to run against a production project. There was enough subtlety to the process to record my steps in setup. All commands were performed on a debian 7 VM.

Install and unpack from latest version. For me this was version 1.66.

$ wget -O /tmp/cppcheck_v1-66.tar.bz2 http://sourceforge.net/project/cppcheck/files/cppcheck/1.66/cppcheck-1.66.tar.bz2/download
$ tar -xjvf /tmp/cppcheck_v1-66.tar.bz2 -C /opt


Navigate to the install directory

$ cd /opt/cppcheck_v1-66

Cppcheck requires some special make parameters to be properly configured. Specifically you need to specify where the cfg directory is. ** -j specifies –jobs and is the number of cores make will use in building. I have 4 so I might as well put them to work.

$ make -j 4 SRCDIR=build CFGDIR=/opt/cppcheck_v1-66/cfg
$ make -j 4 install

Published: September 04 2014

blog comments powered by Disqus