Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio code clang executable

I've installed visual studio code on my Ubuntu VM and am using c++. I keep getting the following error covering the pages tab at the top which is really frustrating:

Please install clang or check configuration clang.executable

I have installed clang using apt-get install llvm. I have installed the c++ support from the packages so I'm not trying to do anything complicated here.

I have googled till I'm now blue in the face, has anyone else come across this and now how to get around this.

like image 345
Oliver Avatar asked Jan 22 '26 09:01

Oliver


2 Answers

It seems clang is not installed properly on your ubuntu. Install clang by:

sudo apt-get install clang

clang -v //Now see installed version

Now, error should be fixed.

like image 152
Mahbub Avatar answered Jan 25 '26 12:01

Mahbub


I too had the same problem and resolved it with the following steps.

  1. Installed the llvm plus clang available with the following link http://releases.llvm.org/

  2. Installed the c/c++ lang adapter (choose this one from the list of extensions in the visual studio code.

https://marketplace.visualstudio.com/items?itemName=mitaki28.vscode-clang

  1. Configure the path of the llvm/bin folder installed in step 1 above in the visual studio code 'user settings', with the clang.executable: variable. Please refer to the 'configuration' section explained in the url in step 2.
like image 27
prabhakar Avatar answered Jan 25 '26 10:01

prabhakar