Prostyle1337
Prostyle1337

Reputation: 23

Cppcheck not recognizing Command

I got the following error on Ubuntu 16.04:

$ cppcheck --project=compile_commands.json 
cppcheck: error: unrecognized command line option: "--project=compile_commands.json".

I already tried reinstalling cppcheck. Does anyone know to what this error is related?

Upvotes: 1

Views: 771

Answers (1)

Anya Shenanigans
Anya Shenanigans

Reputation: 94849

cppcheck doesn't support the --project option on the version available by default on Ubuntu 16.04 (xenial). The version of cppcheck there is 1.72

If you wish to use the option --project then install a newer cppcheck.

  • It can be installed from the snap store (sudo snap install cppcheck).
  • It can be installed manually from cppcheck.net - download source, build locally
  • You can upgrade to ubuntu 18.04/20.04 and use the version from there.

Upvotes: 2

Related Questions