Static code analysis in QtCreator with CppCheck

Just a simple tutorial to show you how to add static code analysis plugin in QtCreator on Liunx.
Start by downloading plugin dedicated to QtCreator from here.

Unpack .zip and you will get two directories which you have to copy to /usr/lib/qtcreator/plugins/. You can copy only, if you don’t need Russian translation.

cp lib/qtcreator/plugins/ /usr/lib/qtcreator/plugins/

Now, turn on QtCreator, in top menu select Help -> About plugins and turn on QtCppCheck, restart QtCreator.


Check if you have cppcheck installed:

$which cppcheck

If not, install it now.

analyzerGo to Tools -> Options -> Analyzer, you should see tab named ‘QtcCppcheck‘. Provide path to binary file cppcheck. That’s all.