AtomLinter / linter-clang

Lint C-based files using Clang.
55 stars 29 forks source link

[SOLVED] Error running clang #271

Closed MichelangeloDiGennaro closed 4 years ago

MichelangeloDiGennaro commented 4 years ago

I have this pop-up when i try to use clang

Error: Failed to spawn command `clang`. Make sure `clang` is installed and on your PATH
    at /home/michelangelo/.atom/packages/linter-clang/node_modules/atom-linter/lib/helpers.js:130
    at process._tickCallback (internal/process/next_tick.js:68)

Note that i've installed "LVM" and "Clang and co" from this site. Do i have to change some paths in the settings? I am new to atom so be more precise as possibile. Now i am running ubuntu 19.04.

MichelangeloDiGennaro commented 4 years ago

I've solved the problem alone, and now i'll explain how. This error is caused by the fact that you don't have the executable named "clang" in one of your paths of "$PATH", to see all the "$PATH" you have to write in the terminal this command: echo $PATH The result is a list of paths separeted by ":", for example in my case: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin Now you have to simply search where the executable "clang" is located, and copy it in od theese folders. So for example in my case: sudo cp /usr/lib/llvm-9/bin/clang usr/local/bin I've also write "sudo" because in the most of the case you will do this in directories that need the supervisor status. Note that the first path is the source path, and the second is the destination. Now that you've done that, be sure that the field "executable" of linter-clang is set to default with "clang" written.