Author Topic: Cppcheck not working  (Read 29 times)

Offline jewofi

  • Single posting newcomer
  • *
  • Posts: 1
Cppcheck not working
« on: Today at 01:31:06 am »
Hi,

I downloaded Code::blocks 20.03 and I downloaded CppCheck 1.89 and then went to settings -> environment -> CppCheck and then I add "C:\Program Files\Cppcheck\cppcheck.exe" in the path. And when I use plugin -> cppcheck ... There was an error.

CppCheck Application: C:\Program Files\Cppcheck\cppcheck.exe
CppCheck Arguments: --verbose --enable=all --enable=style --xml
Platform: Windows 7 32 bit
Cppcheck Version: 1.89
Download link: https://sourceforge.net/projects/cppcheck/files/cppcheck/1.89/cppcheck-1.89-x86-Setup.msi/download
Code::blocks version: 20.03
Error message in CppCheck windows:

Code
Running cppcheck/vera++ analysis... please wait...
Switching working directory to : D:\Program1\C++\LearnCPP\demo1\
Executable cppcheck: 'C:\Program Files\Cppcheck\cppcheck.exe'.
Path to cppcheck: 'C:\Program Files\Cppcheck'.
Updated PATH environment to include path to cppcheck: 'C:\Program Files\Cppcheck' ('C:\Program Files\Cppcheck;D:\IDE\CodeBlocks\MinGW\bin;D:\IDE\CodeBlocks\MinGW;C:\Program Files\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\MiKTeX\miktex\bin;D:\CodeEditor\sublime_text_build_4107;D:\ConsoleEmulators\PortableGit\cmd;D:\Compilers-Interpreters\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin').
C:\Program Files\Cppcheck\cppcheck.exe --version
Cppcheck 1.89
Executable cppcheck: 'C:\Program Files\Cppcheck\cppcheck.exe'.
Path to cppcheck: 'C:\Program Files\Cppcheck'.
Updated PATH environment to include path to cppcheck: 'C:\Program Files\Cppcheck' ('C:\Program Files\Cppcheck;D:\IDE\CodeBlocks\MinGW\bin;D:\IDE\CodeBlocks\MinGW;C:\Program Files\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\MiKTeX\miktex\bin;D:\CodeEditor\sublime_text_build_4107;D:\ConsoleEmulators\PortableGit\cmd;D:\Compilers-Interpreters\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin').
C:\Program Files\Cppcheck\cppcheck.exe --verbose --enable=all --enable=style --xml --file-list=CppCheckInput.txt
Checking main.cpp ...
Defines:
Undefines:
Includes:
Platform:win32A
<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
    <cppcheck version="1.89"/>
    <errors>
        <error id="missingIncludeSystem" severity="information" msg="Cppcheck cannot find all the include files (use --check-config for details)" verbose="Cppcheck cannot find all the include files. Cppcheck can check the code without the include files found. But the results will probably be more accurate if all the include files are found. Please check your project&apos;s include directories and add all of them as include directories for Cppcheck. To see what files Cppcheck cannot find use --check-config."/>
    </errors>
</results>
Cppcheck cannot find all the include files (use --check-config for details)

Code
#include <iostream>

void printValue(int value)
{
    std::cout << value;
}

int main()
{
    printValue(5);
    printValue(6);
    printValue(7);

    return 0;
}

Thanks in advance.

Online AndrewCot

  • Almost regular
  • **
  • Posts: 177
Re: Cppcheck not working
« Reply #1 on: Today at 03:20:39 am »
I have CPPCheck 2.5 installed and it works okay, but I am on Win10 x64.

My Environment settings for CppCheck are:
    App:             C:\Program Files\Cppcheck\cppcheck.exe
    Arguments:  --verbose --enable=all --enable=style --xml

Have you checked to see if there is a latter version of CPPcheck that supports XP and if there is give it a go.
Have you tried to use the cppcheckgui.exe program and does it work? If it does not then I would get it working and then based on the configuration you needed update the arguments in the environment settings in C::B.

Be aware that this is a CPPCheck configuration issue and NOT a C::B issue, so if the items above do not help then I would be asking on the CPPCheck forum for help.