# ERROR: Clang must be installed in order to build this target

**URL:** <https://forums.unrealengine.com/t/error-clang-must-be-installed-in-order-to-build-this-target/483325>\
**Category:** Platform & Builds\
**Tags:** error, compilation-error, Linux, unreal-engine, question\
**Created:** [May 13, 2021, 1:39pm UTC](https://forums.unrealengine.com/t/error-clang-must-be-installed-in-order-to-build-this-target/483325 "2021-05-13T13:39:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![j\_mudo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@j\_mudo](https://forums.unrealengine.com/u/j_mudo)\
**Post date:** [May 13, 2021, 1:39pm UTC](https://forums.unrealengine.com/t/error-clang-must-be-installed-in-order-to-build-this-target/483325/1 "2021-05-13T13:39:59Z")

</div>

I’ve been trying to generate a clang database to use with my editor on linux for what amounts to 3 days now and UBT doesn’t seem to want to do that. I’ve tried tweaking the ClangPath at Engine/Source/Programs/UnrealBuildTool/Platform/Linux/LinuxToolchain.cs, tried setting environment variables, tried tweaking the Engine/Build/BatchFiles/Linux/Build.sh script but it seems UBT don’t want to work on this mode. And yes, I have both the engine clang toolchain and the compiler installed locally

---

<div class="post-metadata">

**Author:** ![kaiizoku](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kaiizoku](https://forums.unrealengine.com/u/kaiizoku)\
**Post date:** [November 25, 2021, 2:51am UTC](https://forums.unrealengine.com/t/error-clang-must-be-installed-in-order-to-build-this-target/483325/2 "2021-11-25T02:51:11Z")

</div>

HI! I just have the same problem and it seems that UBT actually checks for clang.exe path to be present. I tried to generalize it in [this PR](https://github.com/EpicGames/UnrealEngine/pull/8663) to work for Mac and Linux.  
I tested in Linux and it generated the database.

---

<div class="post-metadata">

**Author:** ![k\_ck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@k\_ck](https://forums.unrealengine.com/u/k_ck)\
**Post date:** [November 10, 2022, 10:04pm UTC](https://forums.unrealengine.com/t/error-clang-must-be-installed-in-order-to-build-this-target/483325/3 "2022-11-10T22:04:39Z")

</div>

In case anyone stumbles upon this thread, I’ve just fixed this error error on Windows by setting `LLVM_PATH` environment variable to a directory where LLVM was installed. See `FindToolChainInstallations` method in `UEBuildWindows.cs` for details.

---

<div class="post-metadata">

**Author:** ![Gadgetron\_corp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gadgetron\_corp](https://forums.unrealengine.com/u/Gadgetron_corp)\
**Post date:** [February 28, 2026, 10:01pm UTC](https://forums.unrealengine.com/t/error-clang-must-be-installed-in-order-to-build-this-target/483325/4 "2026-02-28T22:01:27Z")

</div>

If you are trying to run clang in order to create compile\_commands.json then my solution for you is one of two.

If you are on a rolling release OS (like arch linux) then you must have a newer unreal engine version that matches compatibility with your rolling release operating system clang. UE5 wont have this issues with compatibility but ue4 will.

Option two: if you are trying to use ue4 and that error still happens then you can generate compile\_commands.json by avoiding clang and instead you would use cmake:

cmake -DCMAKE\_EXPORT\_COMPILE\_COMMANDS=ON
