# UE 5.4 compile error Catch2

**URL:** <https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [March 24, 2024, 8:51pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453 "2024-03-24T20:51:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![LightWizzard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lightwizzard/32/546646_2.png) [@LightWizzard](https://forums.unrealengine.com/u/LightWizzard)\
**Post date:** [March 24, 2024, 8:51pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/1 "2024-03-24T20:51:55Z")

</div>

I created a new project with Blueprint and no content, then I created an empty C++ class, then complied, and got an error  
File  
\UE\_5.4\Engine\Source\Developer\LowLevelTestsRunner\LowLevelTestsRunner.Build.cs  
Line  
Path.Combine(Target.UEThirdPartySourceDirectory, “Catch2”, Catch2.Version, “src”)

Catch2 has no reference.

I am using VS 2022.

Looking at file  
`\UE_5.4\Engine\Source\ThirdParty\Catch2\Catch2_v3.4.0.tps`  
and  
`\UE_5.4\Engine\Source\ThirdParty\Catch2\Catch2.tps`

I went back to how UE5.3 worked and changed it to version 3.4

Path.Combine(Target.UEThirdPartySourceDirectory, “Catch2”, “v3.4.0”, “src”)

The project will now compile without errors.

This is a C# code issue, but only one you will get if you try to add a C++ class and recompile.

I have no idea if I should use v3.4, but this change to calling Check2 is new to 5.4.

Catch2 is part of the Test Framework, and I thought it was C++, but this error is because Catch2 is not referenced in the C# file, and calling Catch2 to get its version number is a good solution, it would require a reference to use it, so this looks like a bug, but this is a preview, so I am wondering if anyone else had this issue. I searched for this issue, but did not find it.

I did not want to report a but unless I know there is one, this appears to be a new feature someone was implementing, but I am not sure how they got it to work.

Can someone with 5.4 installed test this by creating a blank project and adding an empty C++ project, and then recompile the project using VS 2020 Community, because that is the version we should be using in 5.4, from what I have read.

I did not make any custom installations or change any settings in VS, other than those recommended by UE, so I have C++ for Unreal installed, as well as C++, and C#, which seemed to be the only ones I needed to add.

I have never tried to call a C++ function from a C# program, I normally keep them separate. Assuming Catch2 has no C# version, because that would be confusing, so calling Catch2 in C# to get its version is new to me, so I am missing something here.

I assume they are using this GitHub version

> **[GitHub - catchorg/Catch2: A modern, C++-native, test framework for...](https://github.com/catchorg/Catch2)**
>
> A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch) - catchorg/Catch2

I see that version 3 has been released, and that made me think this is a new release feature, in which case I have no idea how they meant to implement it.

I am only posting the way I fixed this, and this is only for the project, this is part of the Engine that gets installed into the project, so I have no idea what version it should be, because that depends on the version you have installed.

It would be easier to read the xml file, and just add a version

\UE\_5.4\Engine\Source\ThirdParty\Catch2\Catch2\_v3.4.0.tps  
and  
\UE\_5.4\Engine\Source\ThirdParty\Catch2\Catch2.tps

```auto
  <Name>Catch2</Name>
  <Version>v3.4.0</Version>

```

This would be easy for C# to parse and get the correct version, according to this tps file.

This is an auto-generated code and I am willing to bet it has been fixed upstream and have no idea how it shipped in this state, someone started something, but did not finish it, yet we still have to use this version of the release right now.

---

<div class="post-metadata">

**Author:** ![Socke81](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/socke81/32/1194535_2.png) [@Socke81](https://forums.unrealengine.com/u/Socke81)\
**Post date:** [April 4, 2024, 2:48pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/2 "2024-04-04T14:48:17Z")

</div>

I am in the process of porting my code plugins from 5.3 to 5.4 and also have this error. Here are the logs.

```auto
2>C:\Unreal Engine\UE_5.4\Engine\Source\Developer\LowLevelTestsRunner\LowLevelTestsRunner.Build.cs(19,65,19,71): error CS0103: The name 'Catch2' does not exist in the current context
2>Done building project "UE5Rules.csproj" -- FAILED.
4>------ Build started: Project: UE5ProgramRules, Configuration: Development Any CPU ------
4>CSC : error CS0006: Metadata file 'C:\Unreal Engine\UE_5.4\Engine\Intermediate\Build\BuildRulesProjects\UE5Rules\bin\Development\ref\UE5Rules.dll' could not be found
4>Done building project "UE5ProgramRules.csproj" -- FAILED.
5>------ Build started: Project: BasicCode54ModuleRules, Configuration: Development Any CPU ------
5>CSC : error CS0006: Metadata file 'C:\Unreal Engine\UE_5.4\Engine\Intermediate\Build\BuildRulesProjects\UE5ProgramRules\bin\Development\ref\UE5ProgramRules.dll' could not be found
5>CSC : error CS0006: Metadata file 'C:\Unreal Engine\UE_5.4\Engine\Intermediate\Build\BuildRulesProjects\UE5Rules\bin\Development\ref\UE5Rules.dll' could not be found
5>Done building project "BasicCode54ModuleRules.csproj" -- FAILED.
type or paste code here

```

---

<div class="post-metadata">

**Author:** ![mmssda](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mmssda](https://forums.unrealengine.com/u/mmssda)\
**Post date:** [April 15, 2024, 1:34pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/3 "2024-04-15T13:34:19Z")

</div>

I’ve tried building 5.4 from source, but it does not support TOptional as UPROPERTY. Is there a way to fix this in the release preview?

---

<div class="post-metadata">

**Author:** ![mmssda](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mmssda](https://forums.unrealengine.com/u/mmssda)\
**Post date:** [April 15, 2024, 2:14pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/4 "2024-04-15T14:14:17Z")

</div>

For whoever runs into this as it is the only result on Google.  
You can go into the file that is causing the error, remove “Catch2.version” and replace it with “v3.4.0”.  
Although be warned, there are a lot of breaking changes, so whatever you’re recompiling probably needs to be updated as well.

---

<div class="post-metadata">

**Author:** ![MulleDK19](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MulleDK19](https://forums.unrealengine.com/u/MulleDK19)\
**Post date:** [April 18, 2024, 7:00am UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/5 "2024-04-18T07:00:04Z")

</div>

I’m getting this with completely new 5.4 projects, created from the third person template, along with a plethora of C++ errors.

---

<div class="post-metadata">

**Author:** ![mmssda](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mmssda](https://forums.unrealengine.com/u/mmssda)\
**Post date:** [April 18, 2024, 7:52am UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/6 "2024-04-18T07:52:43Z")

</div>

Try building 5.4 from source. It doesn’t have the Catch2 error. But it is missing some features like TOptional as UPROPERTY.

---

<div class="post-metadata">

**Author:** ![Fafhrd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fafhrd](https://forums.unrealengine.com/u/Fafhrd)\
**Post date:** [April 24, 2024, 7:51pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/7 "2024-04-24T19:51:12Z")

</div>

The release version of 5.4 also has this issue. I don’t know how tf they could have missed this.

---

<div class="post-metadata">

**Author:** ![Nelipus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelipus/32/941143_2.png) [@Nelipus](https://forums.unrealengine.com/u/Nelipus)\
**Post date:** [April 24, 2024, 10:47pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/8 "2024-04-24T22:47:21Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/4/2/5422132bcf1623defe6d97e206da80841e2abeb8.png)  
I replaced the “Catch2.version” for “v.3.4.0” and now it’s working, I only had to compile three times, but for now it’s okay

---

<div class="post-metadata">

**Author:** ![jmodev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jmodev/32/710746_2.png) [@jmodev](https://forums.unrealengine.com/u/jmodev)\
**Post date:** [April 25, 2024, 2:06am UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/9 "2024-04-25T02:06:42Z")

</div>

I got this same Catch2 error while trying to move a 5.3 project to 5.4. The project was failing to compile and upon attempting to build in VS 2022, it failed with this error among others.

In case anyone is encountering this error in a similar context, this was the fix:

Open the .sln file, find MyProjectEditor.Target.cs, and make sure DefaultBuildSettings is in there and that it’s set to .Latest (`DefaultBuildSettings = BuildSettingsVersion.Latest;`). In my case this was completely missing, but in some others I’ve seen, it was set to .V2 or the like, which was also causing issues.

After that, try to build your project again (don’t build the solution, just the project!), and it should successfully build, and allow you to open up the project in UE 5.4.

---

<div class="post-metadata">

**Author:** ![oshevoshev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oshevoshev](https://forums.unrealengine.com/u/oshevoshev)\
**Post date:** [April 25, 2024, 9:17am UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/10 "2024-04-25T09:17:20Z")

</div>

This works for me as well, thanks!

---

<div class="post-metadata">

**Author:** ![oshevoshev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oshevoshev](https://forums.unrealengine.com/u/oshevoshev)\
**Post date:** [April 25, 2024, 9:18am UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/11 "2024-04-25T09:18:53Z")

</div>

This looked like a cleaner solution but unfortunately it didn’t work. I was still getting Catch2 those errors (almost Catch22 😃 ) after this change.

---

<div class="post-metadata">

**Author:** ![Victor.Feliz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Victor.Feliz](https://forums.unrealengine.com/u/Victor.Feliz)\
**Post date:** [April 25, 2024, 2:48pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/12 "2024-04-25T14:48:09Z")

</div>

Unfortunately I’m having the same problem with a fresh project (UE5.4)

---

<div class="post-metadata">

**Author:** ![Gregorshin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gregorshin](https://forums.unrealengine.com/u/Gregorshin)\
**Post date:** [April 26, 2024, 12:44pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/13 "2024-04-26T12:44:37Z")

</div>

Same for me, blank project c++ created on UE5.4

---

<div class="post-metadata">

**Author:** ![Amanda.Schade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Amanda.Schade](https://forums.unrealengine.com/u/Amanda.Schade)\
**Post date:** [April 27, 2024, 12:28am UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/14 "2024-04-27T00:28:49Z")

</div>

Hey folks - we’ve addressed this issue with a QFE, [Current Available Quick-Fix Solutions](https://forums.unrealengine.com/t/current-available-quick-fix-solutions/2829).

Depending on your platform, try these steps:

- [Windows] Download, extract, and run this file: [https://cdn.unrealengine.com/qfe/QFE-5.4-Catch2v340FixV2-CL-33253351-PF-33256503-Job-98b131.exe](https://cdn.unrealengine.com/qfe/QFE-5.4-Catch2v340FixV2-CL-33253351-PF-33256503-Job-98b131.exe)

- [Mac] Download, extract, and run this file: [https://cdn.unrealengine.com/qfe/QFE-5.4-Catch2v340FixV2-CL-33253351-PF-33256503-Job-98b131-Signed.zip](https://cdn.unrealengine.com/qfe/QFE-5.4-Catch2v340FixV2-CL-33253351-PF-33256503-Job-98b131-Signed.zip)

- [Linux] Download the file into the base directory of your binary install and type `unzip <filename>`. Allow unzip to overwrite any files it comes across by hitting ‘A’ when prompted. You should see that the files have been added to Engine/Source/ThirdParty/Catch2/.  
[https://cdn.unrealengine.com/qfe/QFE-5.4-Catch2v340FixV2-CL-33253351-PF-33256503-Job-98b131.zip](https://cdn.unrealengine.com/qfe/QFE-5.4-Catch2v340FixV2-CL-33253351-PF-33256503-Job-98b131.zip)

Thanks for reporting!

---

<div class="post-metadata">

**Author:** ![fcortese](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fcortese](https://forums.unrealengine.com/u/fcortese)\
**Post date:** [April 27, 2024, 3:10pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/15 "2024-04-27T15:10:48Z")

</div>

This does not seem to fix the issue, still getting “`LowLevelTestsRunner.Build.cs(19,65): Error CS0103 : The name 'Catch2' does not exist in the current context`” error as usual.

---

<div class="post-metadata">

**Author:** ![ChrisSF](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrissf/32/710746_2.png) [@ChrisSF](https://forums.unrealengine.com/u/ChrisSF)\
**Post date:** [April 27, 2024, 8:30pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/16 "2024-04-27T20:30:06Z")

</div>

If the issue persists, regenerating the project (Visual Studio, XCode etc) will ensure the third party files are properly included.

**For Windows:**  
Open _Powershell_ and navigate to the root directory of your Unreal Engine 5.4 installation - typically **“C:\Program Files\Epic Games\UE\_5.4”** - and execute the following command using the project file absolute path:

> .\Engine\Build\BatchFiles\Build.bat -ProjectFiles -project=“Absolute\_Path\_To\_Project\Project\_File.uproject” -game -engine

**For Mac:**  
Open _Terminal_ and use **./Engine/Build/BatchFiles/Mac/Build.sh** instead, the rest of the command is similar, just make sure that the path to the _.uproject_ file is absolute.

**For Linux:**  
Similar with Mac but using **./Engine/Build/BatchFiles/Linux/Build.sh** instead.

---

<div class="post-metadata">

**Author:** ![SilentGarud](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/silentgarud/32/1216315_2.png) [@SilentGarud](https://forums.unrealengine.com/u/SilentGarud)\
**Post date:** [April 28, 2024, 3:26pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/17 "2024-04-28T15:26:12Z")

</div>

> [@Amanda.Schade](#):
>
> Engine/Source/ThirdParty/Catch2/

Thanks for the quick fix! I haven’t installed a QFE before, so have a few questions.

- In windows, does the QFE do anything else other than add the missing files in `Engine/Source/ThirdParty/Catch2/`?
- Is the installer uninstallable or does it just unpack a zip into the location? If so, how do I remove the QFE if I need to for whatever reason.

---

<div class="post-metadata">

**Author:** ![Amanda.Schade](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Amanda.Schade](https://forums.unrealengine.com/u/Amanda.Schade)\
**Post date:** [April 29, 2024, 7:19pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/18 "2024-04-29T19:19:58Z")

</div>

> [@SilentGarud](#):
>
> In windows, does the QFE do anything else other than add the missing files in `Engine/Source/ThirdParty/Catch2/`?
> 
> Is the installer uninstallable or does it just unpack a zip into the location?

Nope, it just adds the files. And since it’s not an installer, there aren’t means to uninstall it.

---

<div class="post-metadata">

**Author:** ![Jaworekplay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jaworekplay](https://forums.unrealengine.com/u/Jaworekplay)\
**Post date:** [April 29, 2024, 8:16pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/19 "2024-04-29T20:16:21Z")

</div>

have you tried searching for Catch2.Version and replacing it with “3.4.0”?

---

<div class="post-metadata">

**Author:** ![BulleTime](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BulleTime](https://forums.unrealengine.com/u/BulleTime)\
**Post date:** [April 30, 2024, 1:31pm UTC](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453/20 "2024-04-30T13:31:37Z")

</div>

The fix worked for me migrating my project from 5.3 to 5.4. Thanks!

[Next page](https://forums.unrealengine.com/t/ue-5-4-compile-error-catch2/1770453.md?page=2)
