Error building 4.16 branch from source - can't build Oculus lib

Hi All,

I need to do an engine rebuild so that I can disable audio muting when the VR preview window becomes defocussed (would be great to have that exposed as an editor preference :slight_smile: ). I cloned the 4.16 branch from github, followed all the normal steps, but have run into this error:

2>d:\workspace\unrealengine\engine\source\runtime\d3d12rhi\private\D3D12StateCachePrivate.h(716): error C4596: 'SetPipelineState': illegal qualified name in member declaration
2>d:\workspace\unrealengine\engine\source\runtime\d3d12rhi\private\D3D12StateCachePrivate.h(716): error C4596: 'SetPipelineState': illegal qualified name in member declaration
2>ERROR : UBT error : Failed to produce item: D:\workspace\UnrealEngine\Engine\Plugins\Runtime\OculusRift\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-OculusRift.lib

Iā€™ve successfully build many engine versions before, but this is a completely new error to me and is a bit beyond me. Iā€™m guessing that this must be something particular to my setup but am at a loss of things to try to resolve it. Does anyone have any words of advice they could share?

Building on Windows 10 using Visual Studio 2017,

Thanks!

Hi!

Since 4.16 is a preview, you could be running into a bug Epic didnā€™t catch. I can see that the file in question was changed 13 days ago. Try working with 4.15.2 and see if you get the same issue. In general, itā€™s not quite safe to do real development with a preview version.

It might also be helpful to submit a bug so Epic can look into it before 4.16 is put into production. You can do that here: https://answers.unrealengine.com/spaces/11/bugs-and-crashes.html.

If you have this problem with 4.15.2 then we can try to dig deeper.

Actually, I see that SetPipelineState() used to just be declared but now itā€™s implemented in the header, with a template statement in front of it. That may be causing the problem. Looks like the change was done via this PR: .com/EpicGames/UnrealEngine/pull/3512. You may want to talk to the devs involved in that. You may be able to help them if something isnā€™t right with their changes.

Thanks @anonymous_user_64f7311b, thatā€™s very helpful. Will try building 4.15.2

As a complete aside, I discovered after the fact that I could change this without recompiling the engine by setting this variable in Config/DefaultEngine.ini:

[Audio]
 UnfocusedVolumeMultiplier=1.0

Ah wellā€¦ at least the effort seems to have uncovered a bug. Time well spent.

LOL. Been thereā€¦

Change

D3D12_STATE_CACHE_INLINE void
FD3D12StateCacheBase::SetPipelineState(FD3D12PipelineState*
PSO)

to

D3D12_STATE_CACHE_INLINE void
SetPipelineState(FD3D12PipelineState*
PSO)

i.e. remove ā€œFD3D12StateCacheBase::ā€ as it isnā€™t needed and VS2017 throws an error for it.

Andrew

Thanks Andrew! @, did you see this?

Yes I did. Iā€™m looking into it now. We have other people on our QA team who havenā€™t reported any issues like this so Iā€™m collaborating with them about it.

Interesting. The version that Iā€™ve been building with is

Microsoft Visual Studio Community 2017 
Version 15.2 (26430.4) Release
VisualStudio.15.Release/15.2.0+26430.4
Microsoft .NET Framework
Version 4.7.02046

Not quite the same, but close. Are you saying that the problem occurs with the latest updates?

From what weā€™ve seen it only seems to affect Visual Studio Community 2017 from Version 15.1 (mine specifically is the 26403.7 release). VSC2017 without an update is unaffected.

Yeah, the error seems to have been introduced in the first update

I got the same issue, and the version of my VS Community 2017 is 15.2 (26430.6)

Iā€™ve had this too, I did a completely clean Windows Installation before merging in the the 4.16 ā€˜releaseā€™ changes if that helps.

I just ran into the same problem and as previously posted, removing FD3D12StateCacheBase:: from the file D3D12StateCachePrivate.h fixed the problem for me as well. Iā€™m compiling the latest 4.16 source from GIT and using Visual Studio Community 2017 (Version 15.2 26430.15).

thanks mate!

Hey, youā€™ll need to post the output log from Visual Studio for anyone to have a chance at helping you. Otherwise no-one can see what the error actually is.

I had this issue on a build controller that only had Microsoft SDK 10, .NET 4.6.1 and Microsoft Build Tools installed.

The problem still persists in 4.16.3-release with VS 2017 Community 15.2 (26430.16). The suggested fix below works.

Iā€™ve had the same issue, windows 10, visual studio community 2017 4.16.3, what in the world is going on hereā€¦?