Menu

unable to install cppchecker with yum/apt-get

2022-11-21
2022-11-23
  • Prasad Gattu

    Prasad Gattu - 2022-11-21

    Hi Team ,

    I am using container image where I am trying to install the cppchecker using yum/apt-get but I am getting below message. How to use this software on linux machines?

    • apt-get install cppcheck
      Reading package lists...
      Building dependency tree...
      Reading state information...
      E: Unable to locate package cppcheck

    Thanks,
    Prasad.

     
  • Daniel Marjamäki

    that is very strange. what specific distro do you use? is it some rare architecture?
    does it help if you run apt-get update first?

     
  • Prasad Gattu

    Prasad Gattu - 2022-11-22

    Iam using python python:2.7.17 container available in dockerhub . I will try to do that apt-get update

     
  • Prasad Gattu

    Prasad Gattu - 2022-11-22

    Iam using python python:2.7.17 container available in dockerhub . I will try to do that apt-get update

     
  • Prasad Gattu

    Prasad Gattu - 2022-11-22

    it worked. I am getting 2.3 verison of cppcheck, how to get the latest version? How to use it from on ubuntu/linux https://github.com/danmar/cppcheck/releases/tag/2.9

     
  • Daniel Marjamäki

    Iam using python python:2.7.17 container available in dockerhub

    that is probably pretty old.

    Personally I would compile latest cppcheck. its quite easy. Example:

    wget https://github.com/danmar/cppcheck/archive/refs/tags/2.9.tar.gz
    tar xzvf 2.9.tar.gz
    cd cppcheck-2.9
    make MATCHCOMPILER=yes CXXFLAGS=-O2
    => you will get a cppcheck binary in current folder.
    
     
  • Daniel Marjamäki

    or use a later ubuntu image for cppcheck analysis

     
  • Prasad Gattu

    Prasad Gattu - 2022-11-23

    Though I used python:3.6 I am not able to get the latest version. I hope above steps works in this image and or they specific to any platform? I will try and let you know. Thank you for your assistance.

     
  • Prasad Gattu

    Prasad Gattu - 2022-11-23

    Hi Daniel Marjamäki,

    I want to ignore a specific directory while scanning the cpp files, how to ignore the directory? -i option is not working actually. Above make process worked for me.

    Thanks
    prasad.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.