|
1 | | -# Cppcheck # |
| 1 | +# Cppcheck |
2 | 2 |
|
3 | | -## Donations ## |
| 3 | +## Donations |
4 | 4 |
|
5 | | -### Donations ### |
| 5 | +### Donations |
6 | 6 |
|
7 | 7 | If you find Cppcheck useful for you, feel free to make a donation. |
8 | 8 |
|
9 | 9 | [](http://pledgie.com/campaigns/4127) |
10 | 10 |
|
11 | | -## About the name ## |
| 11 | +## About the name |
12 | 12 |
|
13 | | -The original name of this program is "C++check" but it was later changed to "cppcheck". |
| 13 | +The original name of this program was "C++check", but it was later changed to "Cppcheck". |
14 | 14 |
|
15 | 15 | Despite the name, Cppcheck is designed for both C and C++. |
16 | 16 |
|
17 | | -## Manual ## |
| 17 | +## Manual |
18 | 18 |
|
19 | | -A manual is available online: |
20 | | -http://cppcheck.sf.net/manual.pdf |
| 19 | +A manual is available [online](http://cppcheck.sf.net/manual.pdf). |
21 | 20 |
|
22 | | -## Compiling ## |
| 21 | +## Compiling |
23 | 22 |
|
24 | 23 | Any C++ compiler should work. |
25 | 24 |
|
26 | 25 | To build the GUI, you need Qt. |
27 | 26 |
|
28 | | -When building the command line tool, PCRE is normally used. |
| 27 | +When building the command line tool, [PCRE](http://www.pcre.org/) is normally used. |
29 | 28 | PCRE is optional. |
30 | 29 |
|
31 | 30 | There are multiple compilation choices: |
32 | 31 | * qmake - cross platform build tool |
33 | | -* Windows: Visual Studio |
34 | | -* Windows: Qt Creator + mingw |
| 32 | +* Windows: Visual Studio or Qt Creator or MinGW |
35 | 33 | * gnu make |
36 | 34 | * g++ |
37 | 35 |
|
38 | | -### qmake ### |
| 36 | +### qmake |
39 | 37 |
|
40 | 38 | You can use the gui/gui.pro file to build the GUI. |
41 | 39 |
|
42 | | - cd gui |
43 | | - qmake |
44 | | - make |
| 40 | +``` |
| 41 | +cd gui |
| 42 | +qmake |
| 43 | +make |
| 44 | +``` |
45 | 45 |
|
46 | | -### Visual Studio ### |
| 46 | +### Visual Studio |
47 | 47 |
|
48 | 48 | Use the cppcheck.sln file. The rules are normally enabled. |
49 | 49 |
|
50 | | -To compile with rules (pcre dependency): |
51 | | -* the pcre dll is needed. it can be downloaded from: http://cppcheck.sf.net/pcre-8.10-vs.zip |
| 50 | +To compile with rules (PCRE dependency): |
| 51 | +* the PCRE dll is needed. It can be downloaded from [here](http://cppcheck.sf.net/pcre-8.10-vs.zip). |
52 | 52 |
|
53 | 53 | To compile without rules (no dependencies): |
54 | | -* remove the preprocessor define HAVE_RULES from the project |
| 54 | +* remove the preprocessor define `HAVE_RULES` from the project |
55 | 55 | * remove the pcre.lib from the project |
56 | 56 |
|
57 | | -### Qt Creator + mingw ### |
| 57 | +### Qt Creator + MinGW |
58 | 58 |
|
59 | 59 | The PCRE dll is needed to build the CLI. It can be downloaded here: |
60 | 60 | http://software-download.name/pcre-library-windows/ |
61 | 61 |
|
62 | | -### gnu make ### |
| 62 | +### gnu make |
63 | 63 |
|
64 | | -To build Cppcheck with rules (pcre dependency): |
| 64 | +To build Cppcheck with rules (PCRE dependency): |
65 | 65 |
|
66 | | - make HAVE_RULES=yes |
| 66 | +``` |
| 67 | +make HAVE_RULES=yes |
| 68 | +``` |
67 | 69 |
|
68 | 70 | To build Cppcheck without rules (no dependencies): |
69 | 71 |
|
70 | | - make |
| 72 | +``` |
| 73 | +make |
| 74 | +``` |
71 | 75 |
|
72 | | -### g++ (for experts) ### |
| 76 | +### g++ (for experts) |
73 | 77 |
|
74 | 78 | If you just want to build Cppcheck without dependencies then you can use this command: |
75 | 79 |
|
76 | | - g++ -o cppcheck -Ilib cli/*.cpp lib/*.cpp |
| 80 | +``` |
| 81 | +g++ -o cppcheck -Ilib cli/*.cpp lib/*.cpp |
| 82 | +``` |
77 | 83 |
|
78 | | -If you want to use --rule and --rule-file then dependencies are needed: |
| 84 | +If you want to use `--rule` and `--rule-file` then dependencies are needed: |
79 | 85 |
|
80 | | - g++ -o cppcheck -lpcre -DHAVE_RULES -Ilib -Iexternals cli/*.cpp lib/*.cpp externals/tinyxml/*.cpp |
| 86 | +``` |
| 87 | +g++ -o cppcheck -lpcre -DHAVE_RULES -Ilib -Iexternals cli/*.cpp lib/*.cpp externals/tinyxml/*.cpp |
| 88 | +``` |
81 | 89 |
|
82 | | -### mingw ### |
| 90 | +### MinGW |
83 | 91 |
|
84 | | - make LDFLAGS=-lshlwapi |
| 92 | +``` |
| 93 | +make LDFLAGS=-lshlwapi |
| 94 | +``` |
85 | 95 |
|
86 | | -### Cross compiling Win32 (CLI) version of Cppcheck in Linux ### |
| 96 | +### Cross compiling Win32 (CLI) version of Cppcheck in Linux |
87 | 97 |
|
88 | | - sudo apt-get install mingw32 |
89 | | - make CXX=i586-mingw32msvc-g++ LDFLAGS="-lshlwapi" |
90 | | - mv cppcheck cppcheck.exe |
| 98 | +``` |
| 99 | +sudo apt-get install mingw32 |
| 100 | +make CXX=i586-mingw32msvc-g++ LDFLAGS="-lshlwapi" |
| 101 | +mv cppcheck cppcheck.exe |
| 102 | +``` |
91 | 103 |
|
92 | | -## Webpage ## |
| 104 | +## Webpage |
93 | 105 |
|
94 | 106 | http://cppcheck.sourceforge.net/ |
0 commit comments