Skip to content

Instantly share code, notes, and snippets.

@iamazeem
Created June 26, 2023 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamazeem/064c8014f218bc95d3c36954fb867242 to your computer and use it in GitHub Desktop.
Save iamazeem/064c8014f218bc95d3c36954fb867242 to your computer and use it in GitHub Desktop.
CppCheck 2.11 on Ubuntu 18.04 (build from source)
#!/bin/bash
# uninstall existing cppcheck
sudo apt purge cppcheck -y
# download, build and install
cd ~/Downloads
wget https://github.com/danmar/cppcheck/archive/refs/tags/2.11.tar.gz
tar -xvf 2.11.tar.gz
cd cppcheck-2.11
g++ -o cppcheck -std=c++11 -static -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 cli/*.cpp lib/*.cpp externals/simplecpp/simplecpp.cpp externals/tinyxml2/*.cpp -lpthread
sudo cp -f cppcheck cfg/std.cfg /usr/local/bin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment