Building UE 4.27 fails due to missing Physx headers on Microsoft Windows

At first, it complains about some missing Physix headers e.g.:
Severity Code Description Project File Line Suppression State
Error (active) E1696 cannot open source file “Px.h” UE4 C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Public\PhysXIncludes.h 41

Then it gives the following errors:

Severity Code Description Project File Line Suppression State
Error C2232 ‘->TUniquePtr<FPhysicsMaterialHandle,TDefaultDelete>::IsValid’: left operand has ‘class’ type, use ‘.’ UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 103
Error C2232 ‘->TUniquePtr<FPhysicsMaterialHandle,TDefaultDelete>::IsValid’: left operand has ‘class’ type, use ‘.’ UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 106
Error C3668 ‘AActor::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h 2912
Error C3668 ‘AActor::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\GameFramework\Actor.h 2912
Error C3861 ‘CreateMaterial’: identifier not found UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 105
Error C2065 ‘FAsyncPreRegisterDDCRequest’: undeclared identifier UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C2065 ‘FAsyncPreRegisterDDCRequest’: undeclared identifier UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C2504 ‘FChaosEngineInterface’: base class undefined UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Public\Physics\PhysicsInterfacePhysX.h 173
Error C2504 ‘FChaosEngineInterface’: base class undefined UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Public\Physics\PhysicsInterfacePhysX.h 173
Error C2653 ‘FChaosEngineInterface’: is not a class or namespace name UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 92
Error C2653 ‘FChaosEngineInterface’: is not a class or namespace name UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 105
Error C2653 ‘FChaosEngineInterface’: is not a class or namespace name UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 108
Error C2653 ‘FChaosEngineInterface’: is not a class or namespace name UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 109
Error C2582 ‘operator =’ function is unavailable in ‘FPhysicsMaterialHandle_PhysX’ UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 105
Error C3861 ‘ReleaseMaterial’: identifier not found UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 92
Error C3861 ‘SetUserData’: identifier not found UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 108
Error C2923 ‘TSharedPtr’: ‘FAsyncPreRegisterDDCRequest’ is not a valid template type argument for parameter ‘ObjectType’ UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C2923 ‘TSharedPtr’: ‘FAsyncPreRegisterDDCRequest’ is not a valid template type argument for parameter ‘ObjectType’ UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C2976 ‘TSharedPtr’: too few template arguments UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C2976 ‘TSharedPtr’: too few template arguments UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C3203 ‘TSharedPtr’: unspecialized class template can’t be used as a template argument for template parameter ‘InElementType’, expected a real type UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C3203 ‘TSharedPtr’: unspecialized class template can’t be used as a template argument for template parameter ‘InElementType’, expected a real type UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1649
Error C3668 ‘UActorComponent::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Components\ActorComponent.h 375
Error C3668 ‘UActorComponent::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Components\ActorComponent.h 375
Error C3668 ‘UAnimInstance::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Animation\AnimInstance.h 1285
Error C3668 ‘UAnimNotify::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Animation\AnimNotifies\AnimNotify.h 94
Error C3668 ‘UCurveBase::PostEditChangeProperty’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Curves\CurveBase.h 82
Error C3668 ‘UCurveBase::PostEditChangeProperty’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Curves\CurveBase.h 82
Error C3668 ‘ULevel::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\Level.h 757
Error C3668 ‘ULevel::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\Level.h 757
Error C3668 ‘ULocalPlayer::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\LocalPlayer.h 277
Error C3668 ‘UNetConnection::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\NetConnection.h 814
Error C3668 ‘UNetDriver::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\NetDriver.h 1486
Error C3861 ‘UpdateMaterial’: identifier not found UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 109
Error C3668 ‘USoundEffectSourcePresetChain::PostEditChangeProperty’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Sound\SoundEffectSource.h 62
Error C3668 ‘USoundEffectSourcePresetChain::PostEditChangeProperty’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Sound\SoundEffectSource.h 62
Error C3668 ‘UWorld::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 2563
Error C3668 ‘UWorld::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Classes\Engine\World.h 2563
Error C3668 ‘UWorldSubsystem::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Public\Subsystems\WorldSubsystem.h 24
Error C3668 ‘UWorldSubsystem::GetWorld’: method with override specifier ‘override’ did not override any base class methods UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\Engine\Public\Subsystems\WorldSubsystem.h 24
Error C2664 ‘void FChaosEngineInterface::CreateActor(const FActorCreationParams &,FPhysicsActorHandle &)’: cannot convert argument 2 from ‘Chaos::TGeometryParticle<float,3> *’ to ‘FPhysicsActorHandle &’ HeadlessChaos C:\OPT\UnrealEngine\Engine\Source\Programs\HeadlessChaos\Private\HeadlessChaosTestPhysicsScene.cpp 1377
Error C2664 ‘void FChaosScene::AddActorsToScene_AssumesLocked(TArray<FSingleParticlePhysicsProxy *,FDefaultAllocator> &,const bool)’: cannot convert argument 1 from ‘TArray<Chaos::FGeometryParticle *,FDefaultAllocator>’ to ‘TArray<FSingleParticlePhysicsProxy *,FDefaultAllocator> &’ HeadlessChaos C:\OPT\UnrealEngine\Engine\Source\Programs\HeadlessChaos\Private\HeadlessChaosTestPhysicsScene.cpp 1395
Error C1083 Cannot open include file: ‘ShaderCompiler.h’: No such file or directory UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\NetworkFileSystem\Public\INetworkFileSystemModule.h 7
Error C1083 Cannot open include file: ‘TextureResource.h’: No such file or directory UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\SlateNullRenderer\Private\SlateNullRendererModule.cpp 12
Error MSB3073 The command “…\Build\BatchFiles\Build.bat HeadlessChaos Win64 Development -WaitMutex -FromMsBuild” exited with code 6. HeadlessChaos C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 46
Error MSB3073 The command “…\Build\BatchFiles\Build.bat UnrealFileServer Win64 Development -WaitMutex -FromMsBuild” exited with code 6. UnrealFileServer C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 46
Error C2027 use of undefined type ‘FPhysicsMaterialHandle_PhysX’ UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 103
Error C2027 use of undefined type ‘FPhysicsMaterialHandle_PhysX’ UnrealFileServer C:\OPT\UnrealEngine\Engine\Source\Runtime\PhysicsCore\Private\PhysicalMaterial.cpp 106

I’m having the same issue with building UE5.

I’m also getting errors when trying to compile on Windows 10, Win64, Dev Editor, but from Chaos and stuff…

origin/4.27, latest commit 2021-07-21. sha: acb99cb9fcff4b1952aeb196093819f76c952412

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2664	'void FChaosEngineInterface::CreateActor(const FActorCreationParams &,FPhysicsActorHandle &)': cannot convert argument 2 from 'Chaos::TGeometryParticle<float,3> *' to 'FPhysicsActorHandle &'	HeadlessChaos	D:\Code\UnrealEngine\Engine\Source\Programs\HeadlessChaos\Private\HeadlessChaosTestPhysicsScene.cpp	1377	
Error (active)	E0434	a reference of type "FPhysicsActorHandle &" (not const-qualified) cannot be initialized with a value of type "Chaos::TGeometryParticle<float, 3> *"	HeadlessChaos	D:\Code\UnrealEngine\Engine\Source\Programs\HeadlessChaos\Private\HeadlessChaosTestPhysicsScene.cpp	1377	
Error (active)	E0434	a reference of type "TArray<FPhysicsActorHandle, FDefaultAllocator> &" (not const-qualified) cannot be initialized with a value of type "TArray<Chaos::FGeometryParticle *, FDefaultAllocator>"	HeadlessChaos	D:\Code\UnrealEngine\Engine\Source\Programs\HeadlessChaos\Private\HeadlessChaosTestPhysicsScene.cpp	1395	
Error (active)	E1574	static assertion failed with "TAtomic is only usable with trivial types"	HeadlessChaos	D:\Code\UnrealEngine\Engine\Source\Runtime\Core\Public\Templates\Atomic.h	543	
Warning		The referenced component 'MobileDeviceInterface' could not be found.	AutomationTool			
Error	C2664	'void FChaosScene::AddActorsToScene_AssumesLocked(TArray<FSingleParticlePhysicsProxy *,FDefaultAllocator> &,const bool)': cannot convert argument 1 from 'TArray<Chaos::FGeometryParticle *,FDefaultAllocator>' to 'TArray<FSingleParticlePhysicsProxy *,FDefaultAllocator> &'	HeadlessChaos	D:\Code\UnrealEngine\Engine\Source\Programs\HeadlessChaos\Private\HeadlessChaosTestPhysicsScene.cpp	1395	

I’m having the same issue. Did either of you figure out what the problem was?

I switched to ue5-main branch and it builds fine on Windows. I skipped 4.27 for good.

Having the same issue when compiling 4.27 release.
Any ideas how to fix?

Exact same errors for me after upgrading my source to 4.27.

I also am experiencing this same issue.

Exact same errors.
VS 2017
15.9.18 updated to 15.9.38 same.

Could you please checkout @olivierJT 's answer and let us know if it works for you?

Could you please checkout @olivierJT 's answer and let us know if it works for you? In case it works I’ll accept it as an answer for anyone else coming across this.

Fixed it today!

Using VS 2017
I updated to the latest 15.9.38 (thought that alone didn’t help)

I was missing a (new?) requirement "NuGet Package Manger"
As stated here:
https://github.com/EpicGames/UnrealEngine
I had installed before a “Nuget targets and build tasks” but not the “NuGet Package Manger”

How to?
Go to: C:\Program Files (x86)\Microsoft Visual Studio\Installer and launch vs_installer.exe
Go to modify and then “individual components”
Check “Nuget package manager”
(in My case for I have also the “Nuget targets and build tasks” checked) Unsure why it’s been a while.

Extra optional (not sure it did something) but I also updated my Window Kit.
It usually comes with VS installation though.

The last one is the one that comes with VS2019
I don’t thing it’s a required step.

Rebooted after all that of course (it may help)

It then built without any errors.

Could you please checkout @olivierJT 's answer and let us know if it works for you? In case it works I’ll accept it as an answer for anyone else coming across this.

Fix it by install “Nuget targets and build tasks” by Visual Studio Installer. (I had NuGet Package Manger already installed)

Using Visual Sudio 2019 and Windows SDK 10.0.18362.0

1 Like

I already had Nuget and build tools installed (I do a lot of C# development too). FWIW I also installed the newer version of the Windows SDK. No improvement for me, same errors unfortunately.

I had NuGet Package Manger already installed.
Installing Windows SDK didn’t help either.
The problem is still there. Nothing changed.

“Nuget targets and build tasks” didn’t help with VS 2017.
May be we need to try your configuration of Visual Sudio 2019 + WinSDK 10.0.18362.0.
Last time I did it for 4.26, but I couldn’t build the Engine from source with VS 2019. The same 4.26 build with VS 2017 was OK. May be now it’s opposite situation.
It’s strange that nothing told about it in the documentation. It’s ritten in p.2 “Install Visual Studio 2017”.
Silent VS 2019 migration?

1 Like

Does anyone know what the 4.27-chaos branch is for? That seems to have a working version of the GTEST_TEST in HeadlessChaosTestPhysicsScene.cpp, wherein it calls FChaosEngineInterface::CreateActor() with the expected FPhysicsActorHandle parameter as the second parameter as opposed to TGeometryParticle in the broken 4.27 version. Link to the line in question: https://github.com/EpicGames/UnrealEngine/blob/4.27-chaos/Engine/Source/Programs/HeadlessChaos/Private/HeadlessChaosTestPhysicsScene.cpp#L1511

I’m not a C++ expert by any means but I just cannot for the life of me see a way that this function call can work. There is no overload of FChaosEngineInterface::CreateActor, enabled by macros or otherwise, which takes a TGeometryParticle as the second parameter in the release branch. I’m using a stock version of the engine, I haven’t even started building my game and the engine doesn’t build :frowning: 4.26 was fine.

HIya.

Im getting issues too. Fresh cloe of 4.27 release (as of 19th Sept)
Get this error

1>  [45/115] Module.HeadlessChaos.4_of_5.cpp
1>V:/UnrealEngine/UE427/Engine/Source/Programs/HeadlessChaos/Private/HeadlessChaosTestPhysicsScene.cpp(1377): error C2664: 'void FChaosEngineInterface::CreateActor(const FActorCreationParams &,FPhysicsActorHandle &)': cannot convert argument 2 from 'Chaos::TGeometryParticle<float,3> *' to 'FPhysicsActorHandle &'
1>  V:\UnrealEngine\UE427\Engine\Source\Runtime\PhysicsCore\Public\Chaos/ChaosEngineInterface.h(333): note: see declaration of 'FChaosEngineInterface::CreateActor'

1>V:/UnrealEngine/UE427/Engine/Source/Programs/HeadlessChaos/Private/HeadlessChaosTestPhysicsScene.cpp(1395): error C2664: 'void FChaosScene::AddActorsToScene_AssumesLocked(TArray<FSingleParticlePhysicsProxy *,FDefaultAllocator> &,const bool)': cannot convert argument 1 from 'TArray<Chaos::FGeometryParticle *,FDefaultAllocator>' to 'TArray<FSingleParticlePhysicsProxy *,FDefaultAllocator> &'
1>  V:\UnrealEngine\UE427\Engine\Source\Runtime\PhysicsCore\Public\Chaos/ChaosScene.h(108): note: see declaration of 'FChaosScene::AddActorsToScene_AssumesLocked'