How to install clang-15 or higher? (16 preferably)

I am currently trying to build a project using cmake, and the error that occurs reads:

CMake Error at cmake/tools.cmake:33 (message):
  Compilation with Clang version 14.0.0 is unsupported, the minimum required
  version is 15.
Call Stack (most recent call first):
  CMakeLists.txt:18 (include)

every time I apt get clang, it by default installs a 14 version. How do I fix this?

This is a little urgent, so any help is appreciated. Thanks! 🙂

Asked By: Rajatt


clang has been updated in Ubuntu 22.04, so that it is possible to install clang-15 in Ubuntu 22.04 with the following commands:

sudo apt update
sudo apt install clang-15

The development version of 23.10 has clang 16 in the mantic-proposed/universe software source if you prefer that.

Answered By: karel
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.