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
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
<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.