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'
My system & settings:
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With