2

I want to use Cppcheck's XML report for SonarQube.

https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Code-checkers

But on Cppcheck's official site, I did not find any help with the installation on a Linux server.

Has somebody any working solution for this?

Edit: I like how the sonarqube tag disappeared, thank you @G. And again, for the constant "support". How convenient just to remove it, instead of helping, or letting someone to help who had these issues as well. Unrelated to the question, yes.

Then guess what: My boss wanted to demo this tool, but certainly told him now not to buy the commercial edition. Everything is unrelated with everything. Good marketing for 2017.

1 Answer 1

1

As far as I know, there are no Cppcheck packages built for Linux. However, you may easily clone the Cppcheck repository from GitHub (https://github.com/danmar/cppcheck) and build it yourself. It has no extra dependencies and therefore is easy to build:

cd cppcheck-master
make

Also, I'm not sure about integrating Cppcheck with SonarQube, but there's a detailed article about SonarQube configuration, probably you may find something useful there: https://www.viva64.com/en/m/0037/

Sign up to request clarification or add additional context in comments.

9 Comments

Thanks for the response, will try. Well, SonarQube theoretically can analyze the xml produced by Cppcheck.
Could not build it on the server. lib/analyzerinfo.cpp:113: error: 'struct std::string' has no member named 'back' make: *** [lib/analyzerinfo.o] Error 1
Tried to build it on local, then move it remote, but when running the executable (./cppcheck) it misses libs there: ./cppcheck: /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.15' not found (required by ./cppcheck) ./cppcheck: /lib64/libc.so.6: version GLIBC_2.14' not found (required by ./cppcheck)
Thanks for the clarification. Well, if you're building cppcheck on a different platform, it is expected that some libs will be missing on your server. I'd suggest you build cppcheck right on the server. The error lib/analyzerinfo.cpp:113: error: 'struct std::string' has no member named 'back' make: *** [lib/analyzerinfo.o] Error 1 means that cppcheck project uses features of C++11, and your version of GCC doesn't support it. You may check the version of GCC by issuing gcc --version and update it to the latest version.
Or, as an alternative solution, you may try to specify the -std flag in Makefile, something like this: CXXFLAGS=-std=c++11
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.