Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install Cppcheck using the tar file on Linux?

I'm trying to install Cppcheck via telnet on a Linux box. I have the cppcheck-1.67.tar file and I untar it. I don't see anything that will install it for me. Am I approaching this the correct way?

like image 999
Tony Tran Avatar asked Dec 18 '14 17:12

Tony Tran


2 Answers

Actual on a date publication of this answer.

  1. Download file from there https://sourceforge.net/projects/cppcheck/

  2. Go to the folder with for downloads

    cd ~/Downloads/
    
  3. Unpack archive

    tar -xvf cppcheck-1.76.1.tar.bz2
    
  4. Go to unpacked folder

    cd cppcheck-1.76.1/
    
  5. Install package as root

    sudo make install
    
  6. Check up result

    $ which cppcheck
    /usr/bin/cppcheck
    
  7. Testing it

    $ touch simple.c
    $ echo "int main(){ int a; a + 1; return 0}" > simple.c
    $ cppcheck simple.c
    Checking simple.c ...
    [simple.c:1]: (error) Uninitialized variable: a
    

This package also exists in a standard repository.

$ aptitude search cppcheck
p   cppcheck                      - tool for static C/C++ code analysis

Testing environment

$ lsb_release -a
No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux 8.6 (jessie)
Release:    8.6
Codename:    jessie
$ uname -a
Linux localhost 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
like image 59
PADYMKO Avatar answered Sep 28 '22 06:09

PADYMKO


The instructions are in the readme.txt file. The short answer is make install.

Remember never to install things from a tar file when you can use your distribution's package manager.

like image 30
that other guy Avatar answered Sep 28 '22 08:09

that other guy