c++sublimetextsublimelinter

SublimeLinter cppcheck linter executable not found


I have intalled SublimeLinter and sublimelinter-cppcheck packages to my Sublime Text 3.

The problem is that sublime text is saying SublimeLinter: WARNING: cppcheck deactivated, cannot locate 'cppcheck'. I figured out that cppcheck cannot find linter executable, so I decided that I will add path to linter to my system $PATH property. But the thing is that I cannot find linter executable on my system.

At first I thought that it's not installed but that I realised that it has to install with SublimeLinter package. But it did not. I tried to find it using Unix find command the only result is :

/Users/syky/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.34.2/lib/cocoapods-core/specification/linter

That is not what I am looking for.

I am using Sublime Text 3, Mac OS X Yosemite and ZSH as my shell.


Solution

  • SublimeLinter is looking for the cppcheck executable, which you apparently haven't installed. It is not looking for a file named linter. Please ensure that you have completely read and understood the SublimeLinter-cppcheck documentation before proceeding. The easiest way to install cppcheck is either via Homebrew or MacPorts (my personal favorite). Otherwise, you'll have to download and compile the source, which, if you're programming in C++, I assume you know how to do.

    Once you have cppcheck installed, create a symlink to it in /usr/bin so Sublime can find it. Modifying your ZSH PATH won't do anything, unless you always launch Sublime from Terminal, because the PATH for programs launched from the Dock is different.