# UnrealBuildTool can't find clang on Windows

**URL:** <https://forums.unrealengine.com/t/unrealbuildtool-cant-find-clang-on-windows/469245>\
**Category:** Platform & Builds\
**Tags:** windows, clang, unreal-engine, question\
**Created:** [August 5, 2020, 1:22pm UTC](https://forums.unrealengine.com/t/unrealbuildtool-cant-find-clang-on-windows/469245 "2020-08-05T13:22:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b6870bac1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b6870bac1](https://forums.unrealengine.com/u/anonymous_user_b6870bac1)\
**Post date:** [August 5, 2020, 1:22pm UTC](https://forums.unrealengine.com/t/unrealbuildtool-cant-find-clang-on-windows/469245/1 "2020-08-05T13:22:37Z")

</div>

Hi, I’d like to generate a clang compilation database for my project but have had trouble getting UBT to recognize clang on my machine.  
I’ve tried both the version from the LLVM site (enabling the “add to path” option in the installer) and the version from the Visual Studio installer (temporarily adding clang’s bin directory to the path myself and setting CC and CXX to the correct values). Here’s the command I ran in powershell:

```
& 'Path\To\Build.bat' -mode=GenerateClangDatabase -project="Path\To\BatteryCollector\BatteryCollector.uproject" BatteryCollector Development Win64

```

The output is as follows:

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

```

Am I doing anything wrong?

I have tried looking at the UBT source code and have found where the error is emitted but it’s just a rabbit hole of classes and factory methods and I’m having a hard time finding where exactly it looks for clang.

I’m using version 4.25.3 but have faced the same issues with 4.25.2.

---

<div class="post-metadata">

**Author:** ![Infixter](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Infixter](https://forums.unrealengine.com/u/Infixter)\
**Post date:** [September 4, 2020, 1:18am UTC](https://forums.unrealengine.com/t/unrealbuildtool-cant-find-clang-on-windows/469245/2 "2020-09-04T01:18:13Z")

</div>

From what I can tell, it looks like the UBT expects Clang to be installed at C:\Program Files\LLVM. The UBT specifically verifies that the following file exists: C:\Program Files\LLVM\bin\clang-cl.exe

So I symbolically linked C:\Program Files\LLVM to the folder where I manually built LLVM/Clang. That seems to work, and I am able to generate the compilation database. It’s not my ideal solution, so if anyone has another suggestion, I’d be interested in hearing it!

Hope this helps!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f8ba459f](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f8ba459f](https://forums.unrealengine.com/u/anonymous_user_f8ba459f)\
**Post date:** [October 11, 2020, 5:25pm UTC](https://forums.unrealengine.com/t/unrealbuildtool-cant-find-clang-on-windows/469245/3 "2020-10-11T17:25:55Z")

</div>

Facing the same issue here in Linux. And I can’t also find where that error code is being generated, no clue why it cannot find clang which is installed in my system.
