C++ Python C Makefile CMake HTML Other
Failed to load latest commit information.
Cppcheck.xcodeproj Fix xcode project file Nov 23, 2015
addons Make MISRA C 2012 12.2 work on C++ (#946) Aug 31, 2017
cfg wxwidgets.cfg: Added support for some wxStaticBoxSizer functions. Sep 21, 2017
cli Added C++14 option Sep 22, 2017
cmake CMake: Upgrade Qt4 to Qt5 (#935) Aug 7, 2017
democlient Democlient: Jul 17, 2016
externals bump simplecpp Sep 12, 2017
gui GUI: When creating a new project, set a default value for build dir Sep 25, 2017
htmlreport Improve Python code Jun 4, 2017
lib Unit testing visual studio import Sep 24, 2017
man Manual: Added a getting started chapter for the GUI Aug 12, 2017
platforms #8158: Added platform file: msp430_eabi_large_datamodel.xml. Aug 9, 2017
rules Modernize: make use of 'nullptr' and added a rule-file for finding no… Jul 28, 2017
samples Make warning disappear (#957) Sep 8, 2017
test Unit testing visual studio import Sep 24, 2017
tools extracttests.py: allow that only TP tests are extracted Sep 22, 2017
triage Improve Python code Jun 5, 2017
win_installer Set version to 1.80.99/1.81 dev Jul 30, 2017
.gitignore Add entry May 28, 2017
.mailmap Revert "Revert "Add a .mailmap file."" Oct 4, 2013
.travis.yml Revert "Travis: Add GUI tests" Aug 13, 2017
.travis_suppressions Fix Cppcheck warnings and remove Travis suppressions Oct 29, 2016
AUTHORS AUTHORS: Added KMilhan Sep 2, 2017
CMakeLists.txt CMake: Upgrade Qt4 to Qt5 (#935) Aug 7, 2017
COPYING Licensing: Using the GPL 3 license Oct 26, 2008
Makefile Run dmake. Aug 30, 2017
appveyor.yml Revert "Try to fix AppVeyor timeout. I would like to have VS2010 debu… Nov 18, 2016
build-pcre.txt Updated/Improved several readme files Nov 6, 2015
build.bat batch files: switch to the batch file directory before doing anything… Sep 29, 2012
console_common.pri pro and pri files: remove unneeded empty lines, use spaces for consis… Oct 12, 2012
cppcheck.cbp Removed ExecutionPath Jul 23, 2015
cppcheck.cppcheck Fixed: some gui/temp headers reported missing includes from gui/ folder. Nov 1, 2011
cppcheck.sln Updated Visual Studio solution to VS2017. May 14, 2017
createrelease createrelease: set version in cmake file Jul 29, 2017
doxyfile Comment spelling fixes Feb 28, 2017
generate_coverage_report Adjust options for lcov/genhtml to unmangled symbols and HTML frames Feb 2, 2016
readme.md sync build instructions from readme.txt (#962) Sep 19, 2017
readme.txt Updated build instructions in readme Aug 21, 2017
runastyle Updated AStyle to version 2.05.1 Dec 17, 2015
runastyle.bat Updated AStyle to version 2.05.1 Dec 17, 2015
webreport.sh webreport.sh: run simian Aug 5, 2016



Linux Build Status Windows Build Status Coverity Scan Build Status
Linux Build Status Windows Build Status Coverity Scan Build Status


If you find Cppcheck useful for you, feel free to make a donation.


About the name

The original name of this program was "C++check", but it was later changed to "Cppcheck".

Despite the name, Cppcheck is designed for both C and C++.


A manual is available online.


Any C++11 compiler should work. For compilers with partial C++11 support it may work. If your compiler has the C++11 features that are available in Visual Studio 2010 then it will work. If nullptr is not supported by your compiler then this can be emulated using the header lib/cxx11emu.h.

To build the GUI, you need Qt.

When building the command line tool, PCRE is optional. It is used if you build with rules.

There are multiple compilation choices:

  • qmake - cross platform build tool
  • cmake - cross platform build tool
  • Windows: Visual Studio (VS 2010 and above)
  • Windows: Qt Creator + mingw
  • gnu make
  • g++ 4.6 (or later)
  • clang++


You can use the gui/gui.pro file to build the GUI.

cd gui

Visual Studio

Use the cppcheck.sln file. The file is configured for Visual Studio 2015, but the platform toolset can be changed easily to older or newer versions. The solution contains platform targets for both x86 and x64.

To compile with rules, select "Release-PCRE" or "Debug-PCRE" configuration. pcre.lib (pcre64.lib for x64 builds) and pcre.h are expected to be in /externals then.

Qt Creator + MinGW

The PCRE dll is needed to build the CLI. It can be downloaded here: http://software-download.name/pcre-library-windows/

GNU make

Simple, unoptimized build (no dependencies):


The recommended release build is:

make SRCDIR=build CFGDIR=cfg HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"


  1. SRCDIR=build
    Python is used to optimise cppcheck

  2. CFGDIR=cfg
    Specify folder where .cfg files are found

  3. HAVE_RULES=yes
    Enable rules (PCRE is required if this is used)

  4. CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" Enables most compiler optimizations, disables cppcheck-internal debugging code and enables basic compiler warnings.

g++ (for experts)

If you just want to build Cppcheck without dependencies then you can use this command:

g++ -o cppcheck -std=c++0x -include lib/cxx11emu.h -Iexternals/simplecpp -Iexternals/tinyxml -Ilib cli/*.cpp lib/*.cpp externals/simplecpp/simplecpp.cpp externals/tinyxml/*.cpp

If you want to use --rule and --rule-file then dependencies are needed:

g++ -o cppcheck -std=c++0x -include lib/cxx11emu.h -lpcre -DHAVE_RULES -Ilib -Iexternals/simplecpp -Iexternals/tinyxml cli/*.cpp lib/*.cpp externals/simplecpp/simplecpp.cpp externals/tinyxml/*.cpp


mingw32-make LDFLAGS=-lshlwapi

Other Compiler/IDE

  1. Create a empty project file / makefile.
  2. Add all cpp files in the cppcheck cli and lib folders to the project file / makefile.
  3. Add all cpp files in the externals folders to the project file / makefile.
  4. Compile.

Cross compiling Win32 (CLI) version of Cppcheck in Linux

sudo apt-get install mingw32
make CXX=i586-mingw32msvc-g++ LDFLAGS="-lshlwapi" RDYNAMIC=""
mv cppcheck cppcheck.exe