Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

executable not found; please configure clang-executable

Clang format is not working in VSCode Linux (Ubuntu). After installing clang-format in VSCode, I tried to invoke it and it is giving this error:

executable not found; please configure clang-executable. 
Clang-format is available under '/home/alex/.vscode/extensions/ms-vscode.cpptools-0.10.3/LLVM/bin/clang-format'
like image 405
Alex Punnen Avatar asked Jul 20 '26 04:07

Alex Punnen


2 Answers

My system & settings:

  • Ubuntu 20.04.1 LTS
  • Visual Studio 1.51.1
  • VS extension: Clang-formatter v1.9.0 by Xaver

After installing the extension it was not working. When I looked inside the extension folder in the home folder

~/.vscode/extensions/xaver*

xaver.clang-format-1.9.0/
├── CHANGELOG.md
├── clang-format.png
├── LICENSE.txt
├── node_modules
│   └── sax
│       ├── lib
│       │   └── sax.js
│       ├── LICENSE
│       ├── package.json
│       └── README.md
├── out
│   └── src
│       ├── clangMode.js
│       ├── clangPath.js
│       └── extension.js
├── package.json
├── package-lock.json
├── README.md
├── tslint.json
└── typings.json

Since no bin files were there I installed clang separately with:

sudo apt install clang-format

After this installation the extension in Visual Studio started working.

like image 130
Ambar Avatar answered Jul 21 '26 20:07

Ambar


Even thought I tried configuring the vscode setting.json it was not picking up. Then got the info from https://web.archive.org/web/20170517131553/http://www.codepool.biz/vscode-format-c-code-windows-linux.html and created a link to the target

sudo ln -s /home/alex/.vscode/extensions/ms-vscode.cpptools-0.10.3/LLV
M/bin/clang-format /usr/bin/clang-format
like image 44
Alex Punnen Avatar answered Jul 21 '26 20:07

Alex Punnen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!