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 libQtcCppcheck.so, if you don’t need Russian translation.

cp lib/qtcreator/plugins/libQtcCppcheck.so /usr/lib/qtcreator/plugins/

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

qtcppcheck

Check if you have cppcheck installed:

$which cppcheck
/usr/bin/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.

cppchecktest

[Total: 0    Average: 0/5]