static analysis of C/C++ code
Go to file
Daniel Marjamäki 538e4bd798 astyle formatting 2013-08-16 18:27:54 +02:00
Cppcheck.xcodeproj Update lib file list. Move testcases out of the main build. 2013-08-10 12:55:16 +02:00
cfg
cli cli.pro: dont include tinyxml both from lib.pri and cli.pro 2013-08-04 13:05:25 +02:00
democlient
externals/tinyxml Use TinyXML to write XML files 2013-08-07 16:30:55 +02:00
gui Moved GUI translations into subdirectory /lang 2013-08-03 20:21:13 +02:00
htdocs web archive: don't allow users to delete gtk and windows 2013-08-09 19:25:59 +02:00
htmlreport
lib Symbol database: improved type handling (fix problems in previous commit). Ticket: #4952 2013-08-16 05:42:12 +02:00
man Set version to 1.62 dev 2013-08-03 19:54:39 +02:00
rules
samples
test astyle formatting 2013-08-16 18:27:54 +02:00
tools
win_installer Moved GUI translations into subdirectory /lang 2013-08-03 20:21:13 +02:00
.gitattributes
.gitignore
.travis.yml
AUTHORS AUTHORS: updated authors file. 2013-08-03 07:01:43 +02:00
COPYING
Makefile Makefile: Set debug mode 2013-08-03 18:20:52 +02:00
build-pcre.txt
build.bat
console_common.pri
cppcheck.cbp
cppcheck.cppcheck
cppcheck.sln
cppcheck_vs2010.sln
createrelease
doxyfile Enable more doxygen features (include JS search engine) and one doxygen annotation fix 2013-08-11 17:04:13 +02:00
generate_coverage_report
readme.md
readme.txt
readme_64-bit_Windows.txt
readme_gui.txt
runastyle Updated to AStyle 2.03, require this version 2013-08-07 16:27:37 +02:00
runastyle.bat
webreport.sh

readme.md

Cppcheck

Donations

Donations

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

Donate

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++.

Manual

A manual is available online.

Compiling

Any C++ compiler should work.

To build the GUI, you need Qt.

When building the command line tool, PCRE is normally used. PCRE is optional.

There are multiple compilation choices:

  • qmake - cross platform build tool
  • Windows: Visual Studio or Qt Creator or MinGW
  • gnu make
  • g++

qmake

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

cd gui
qmake
make

Visual Studio

Use the cppcheck.sln file. The rules are normally enabled.

To compile with rules (PCRE dependency):

  • the PCRE dll is needed. It can be downloaded from here.

To compile without rules (no dependencies):

  • remove the preprocessor define HAVE_RULES from the project
  • remove the pcre.lib from the project

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

To build Cppcheck with rules (PCRE dependency):

make HAVE_RULES=yes

To build Cppcheck without rules (no dependencies):

make

g++ (for experts)

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

g++ -o cppcheck -Ilib cli/*.cpp lib/*.cpp

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

g++ -o cppcheck -lpcre -DHAVE_RULES -Ilib -Iexternals cli/*.cpp lib/*.cpp externals/tinyxml/*.cpp

MinGW

make LDFLAGS=-lshlwapi

Cross compiling Win32 (CLI) version of Cppcheck in Linux

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

Webpage

http://cppcheck.sourceforge.net/