SublimeLinter cppcheck linter executable not found - c++

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.

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.

Related

How to install Command Line Tools for Xcode 5.0.2 in OSX Mavericks?

I need to install the Command Line Tools, in order to be able to compile Node C++ stuff.
Using xcode-select
Trying to use
xcode-select --install
Yields
Looking in Xcode's Preferences, Downloads
Trying to access the Downloads panel in Xcode
Version 5.0.2 (5A3005)
Yields
(no option to install Command Line Tools)
How the hell do I install these tools? Installing them by hand didn't help either
Two possible paths.
1)
Use the "Locations" pane in Xcode Preferences. You're looking for something like this:
2)
You can download the tools from Apple's website, where it's sitting:
Interestingly enough, the description for the Command Line tools lists a date, but not a compatible Xcode version. So the one I've opened up the disclosure triangle for is likely to be the one you want.

"g++" not found in PATH [mac/Eclipse/XCODE installed/CDT downloaded]

I get this error when I try to build a c++ project, however I can run cpp apps in Xcode, I've downloaded CDT for Eclipse, so the compiler must be installed.
echo $PATH:
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
I'm using Mac, I've found posts saying download gcc or Xcode, or solutions for Windows, it's very frustrating that I can't find the answer for such an easy problem, so please… How can I set the PATH variable for my cpp projects in Eclipse?
This question should help. It looks like you need to install XCode command line tools separately to use compilers and build systems outside of XCode (e.g. on the command line or in Eclipse).

Eclipse with CDT on Mac

I've been trying to get Eclipse with CDT working on my Mac for a while now. Everything I've searched for talks about Windows and I'm officially stuck.
The errors I get are:
Program "g++" not found in PATH
Program "gcc" not found in PATH
and a few more that seem to stem from a problem with my PATH. I checked gcc, g++, make, and gmake in terminal using --version and they're all installed. Eclipse CDT is supposed to detect where to look for PATH variables and I can't figure out where I would change it or how to change it. Any help would be greatly appreciated!
Edit: The original problem was fixed. My PATH variable in eclipse was empty for some reason so I had to add locations like /usr/bin and /usr/local/bin. Now I get the error that "Symbol 'cout' could not be resolved."
Edit 2: I was able to get everything working by uninstalling everything and reinstalling Eclipse Indigo with CDT.
There is no C / C++ compiler installed.
Options are:
Install gcc from here (best): https://github.com/kennethreitz/osx-gcc-installer
Install all of Xcode (1 gig install)
Install command line tools only from Xcode https://developer.apple.com/downloads/index.action
Once installed make sure you can call the compiler from the command line (type gcc) if it does not work the compiler has not been added to the environment path variable.
Some extra help:
How do I install g++ on MacOS X?
Here is a great tutorial that shows all the necessary steps for linux. I think it should be quite similar.
http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/
Maybe you'll have to add the path to gcc to your PATH variable if none of this is helping. It should work like this:
Open up .bash_profile in a text editor. (If you're using TextEdit, you can do this at the command line with "open -a /Applications/TextEdit.app ~/.bash_profile".) Add the line:
export PATH="/usr/local/bin:$PATH"
to the file. Save the file and open up a new terminal, then type "echo $PATH" to see if it worked correctly.
EDIT: Someone else had the exact same output as you and managed to fix it by replacing his Eclipse version with an older one. You may try to use Helios instead of Indigo or Juno. This is just a temporary solution until something better comes up (in case it really works). I actually prefer Indigo and Helios over Juno, to be honest. In case you have any worries - Helios is the release from 2010 and still pretty good.
For cout - do you have #include ? Note that cout is a part of std namespace - you need to either qualify it or use "using" directive.
You have to alter ~/.bash_profile, see below for the procedure:
open terminal window
send cmd echo $PATH, then copy the -bash output
send cmd touch ~/.bash_profile
send cmd open -a TextEdit.app ~/.bash_profile
bash_profile will be opened, an empty text file, it means, it the first time it is created.
write in the empty bash_profile: PATH='paste the copied items from echo $PATH cmd a while a back'
save it and reopen the terminal, verify the echo $PATH again.
Restart your eclipse.
my solution is
in preference-> c/c++ -> build->enviroment add PATH= /usr/local/bin
hope it is fine for you.

How can I compile and build a program using external library with command line tools come with Xcode?

I am coding a computer vision program, which is using OpenCV 2.4, by Xcode 4.4. I want to compile and make it in the Terminal by g++ or make command. But the system shows a lot of errors that the compiler cannot find the "opencv2/opencv.hpp" file and Vec3d, etc..!
My question is how to configure the system the I can make and build the code in Terminal? Thanks.
First, you need to have command line tools (I guess you already have it)
Bring up Preference in Xcode
Select "Downloads" tab
Select "Components' tab
Click 'install' on the command line tools line.
Then, you need to install OpenCV. I suggest to use Homebrew
setup homebrew, then
brew install opencv
It will install library in /usr/local, which is in g++'s standard lookup path, thus should be ok.
If you still need help, post the log file.

Getting mingw-get to install correctly - mingw/msys path missing plus more!

I'm running windows XP.
I have been following this tutorial and so downloading mingw-get-inst here.
I've done this a couple times and the last time I checked boes to install EVERYTHING including, but not limited to, gcc, g++, MSYS and the MinGW Compiling Suite. I told it to make a program menu shortcut, too.
I believe I have correctly added MinGW/bin to the Environment Settings' Path.
So I have the shortcut to the MSYS shell now. It goes to C:\MinGW\msys\1.0\msys.bat, but the whole msys directory does not exist!
There are tons of "packages" have been downloaded as far as I can tell ("mingw-get show" brings up a lot!), but it doesn't seem like any of it installed correctly.
Also, should I be able to use commands like "g++ foo.cpp -o foo.exe" from cmd.exe or only from the MSYS shell? Because I was unable to use cmd.exe.
Please help!
The MSYS and MinGW installation procedure is a nightmare, and has got worse over the years. If you just want the compiler suite (no UNIX tools like sed, grep), then I suggest you go to Twilight Dragon Media and download GCC from there. If you also want all the tools, including the Bash shell, the easiest way I've found to get them is to install Git for Windows (which you may want anyway), which includes them all. And if you want a C++ IDE that works well with GCC, take a look at Code::Blocks.
What is the result of running, at a cmd.exe prompt, the command echo %Path%? It should (given what you wrote about your system) include “C:\MinGW\bin”—does it?
What is the result of running dir C:\MinGW?
Note that mingw-get show shows details of available packages—those mingw-get knows how to download and install. The installer is a bit primitive, but has gotten better over the last year or so.
If you issue the command $ echo $PATH, you'll notice it contains /mingw/bin But the /mingw directory is unavailable. To mount it, edit the MSYS fstab, adding a line like C:\MinGW /mingw For details, see the MingW Getting Started guide, more specifically section "After Installing You Should..."
You only need to add MinGW/bin to the Windows' Environment Settings' Path if you plan to use MingW's executables outside of MSYS.