LNK 2001 unresolved external symbol

Can’t build Unreal Engine from source because of unresolved external symbols:

PKEY_AudioEndpoint_PhysicalSpeakers
PKEY_AudioEngine_DeviceFormat
PKEY_AudioEngine_OEMFormat

I’ve been looking for the solution but couldn’t find any. Any help would be appreciated

Hi @Javeed_1. You sent us a screenshot of the Error List panel in Visual Studio, which is generally not the right panel to see which errors Unreal is giving.

Hi @Ari_Epic . Thanks for the reply.

Build started...
1>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------
1>Building UE4Editor and ShaderCompileWorker...
1>Using Visual Studio 2019 14.29.30147 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 25 actions with 16 processes...
1>  [1/25] Module.HAPMedia.cpp
1>  [2/25] UE4Editor-HAPMedia.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\HAPMedia\Intermediate\Build\Win64\UE4Editor\Development\HAPMedia\UE4Editor-HAPMedia.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\HAPMedia\Intermediate\Build\Win64\UE4Editor\Development\HAPMedia\UE4Editor-HAPMedia.exp
1>  [3/25] Module.AudioMixerXAudio2.cpp
1>  [4/25] UE4Editor-AudioMixerXAudio2.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\AudioMixerXAudio2\UE4Editor-AudioMixerXAudio2.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\AudioMixerXAudio2\UE4Editor-AudioMixerXAudio2.exp
1>  [5/25] Module.Voice.cpp
1>  [6/25] UE4Editor-Voice.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\Voice\UE4Editor-Voice.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\Voice\UE4Editor-Voice.exp
1>  [7/25] UE4Editor-AudioMixerXAudio2.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\AudioMixerXAudio2\UE4Editor-AudioMixerXAudio2.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\AudioMixerXAudio2\UE4Editor-AudioMixerXAudio2.suppressed.exp
1>Module.AudioMixerXAudio2.cpp.obj : error LNK2001: unresolved external symbol PKEY_AudioEndpoint_PhysicalSpeakers
1>Module.AudioMixerXAudio2.cpp.obj : error LNK2001: unresolved external symbol PKEY_AudioEngine_DeviceFormat
1>Module.AudioMixerXAudio2.cpp.obj : error LNK2001: unresolved external symbol PKEY_AudioEngine_OEMFormat
1>C:\Work\UnrealEngine-4.27.2-release\Engine\Binaries\Win64\UE4Editor-AudioMixerXAudio2.dll : fatal error LNK1120: 3 unresolved externals
1>  [8/25] Module.XAudio2.cpp
1>  [9/25] UE4Editor-XAudio2.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\XAudio2\UE4Editor-XAudio2.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\XAudio2\UE4Editor-XAudio2.exp
1>  [10/25] UE4Editor-Voice.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\Voice\UE4Editor-Voice.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\Voice\UE4Editor-Voice.suppressed.exp
1>  [11/25] UE4Editor-XAudio2.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\XAudio2\UE4Editor-XAudio2.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Intermediate\Build\Win64\UE4Editor\Development\XAudio2\UE4Editor-XAudio2.suppressed.exp
1>  [12/25] Module.AppleProResMedia.cpp
1>  [13/25] UE4Editor-AppleProResMedia.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\AppleProResMedia\Intermediate\Build\Win64\UE4Editor\Development\AppleProResMedia\UE4Editor-AppleProResMedia.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\AppleProResMedia\Intermediate\Build\Win64\UE4Editor\Development\AppleProResMedia\UE4Editor-AppleProResMedia.exp
1>  [14/25] Module.OculusAudio.cpp
1>  [15/25] UE4Editor-OculusAudio.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Runtime\Oculus\OculusAudio\Intermediate\Build\Win64\UE4Editor\Development\OculusAudio\UE4Editor-OculusAudio.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Runtime\Oculus\OculusAudio\Intermediate\Build\Win64\UE4Editor\Development\OculusAudio\UE4Editor-OculusAudio.exp
1>  [16/25] UE4Editor-OculusAudio.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Runtime\Oculus\OculusAudio\Intermediate\Build\Win64\UE4Editor\Development\OculusAudio\UE4Editor-OculusAudio.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Runtime\Oculus\OculusAudio\Intermediate\Build\Win64\UE4Editor\Development\OculusAudio\UE4Editor-OculusAudio.suppressed.exp
1>  [17/25] Module.WmfMedia.cpp
1>  [18/25] UE4Editor-WmfMedia.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\WmfMedia\Intermediate\Build\Win64\UE4Editor\Development\WmfMedia\UE4Editor-WmfMedia.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\WmfMedia\Intermediate\Build\Win64\UE4Editor\Development\WmfMedia\UE4Editor-WmfMedia.exp
1>  [19/25] UE4Editor-HAPMedia.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\HAPMedia\Intermediate\Build\Win64\UE4Editor\Development\HAPMedia\UE4Editor-HAPMedia.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\HAPMedia\Intermediate\Build\Win64\UE4Editor\Development\HAPMedia\UE4Editor-HAPMedia.suppressed.exp
1>  [20/25] UE4Editor-WmfMedia.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\WmfMedia\Intermediate\Build\Win64\UE4Editor\Development\WmfMedia\UE4Editor-WmfMedia.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\WmfMedia\Intermediate\Build\Win64\UE4Editor\Development\WmfMedia\UE4Editor-WmfMedia.suppressed.exp
1>  [21/25] UE4Editor-AppleProResMedia.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\AppleProResMedia\Intermediate\Build\Win64\UE4Editor\Development\AppleProResMedia\UE4Editor-AppleProResMedia.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Media\AppleProResMedia\Intermediate\Build\Win64\UE4Editor\Development\AppleProResMedia\UE4Editor-AppleProResMedia.suppressed.exp
1>  [22/25] Module.OnlineSubsystemUtils.cpp
1>  [23/25] UE4Editor-OnlineSubsystemUtils.lib
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Online\OnlineSubsystemUtils\Intermediate\Build\Win64\UE4Editor\Development\OnlineSubsystemUtils\UE4Editor-OnlineSubsystemUtils.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Online\OnlineSubsystemUtils\Intermediate\Build\Win64\UE4Editor\Development\OnlineSubsystemUtils\UE4Editor-OnlineSubsystemUtils.exp
1>  [24/25] UE4Editor-OnlineSubsystemUtils.dll
1>     Creating library C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Online\OnlineSubsystemUtils\Intermediate\Build\Win64\UE4Editor\Development\OnlineSubsystemUtils\UE4Editor-OnlineSubsystemUtils.suppressed.lib and object C:\Work\UnrealEngine-4.27.2-release\Engine\Plugins\Online\OnlineSubsystemUtils\Intermediate\Build\Win64\UE4Editor\Development\OnlineSubsystemUtils\UE4Editor-OnlineSubsystemUtils.suppressed.exp
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat -Target="UE4Editor Win64 Development" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 6.
1>Done building project "UE4.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

This is the output of the build.

1>Module.AudioMixerXAudio2.cpp.obj : error LNK2001: unresolved external symbol PKEY_AudioEndpoint_PhysicalSpeakers
1>Module.AudioMixerXAudio2.cpp.obj : error LNK2001: unresolved external symbol PKEY_AudioEngine_DeviceFormat
1>Module.AudioMixerXAudio2.cpp.obj : error LNK2001: unresolved external symbol PKEY_AudioEngine_OEMFormat
1>C:\Work\UnrealEngine-4.27.2-release\Engine\Binaries\Win64\UE4Editor-AudioMixerXAudio2.dll : fatal error LNK1120: 3 unresolved externals

Oh, what do you know, the Errors List panel was right! :smile:

This is a really weird error, since these PKEY symbols are properties from the win32 API of Windows :thinking:
I guess… try deleting the Intermediate folder, uhm… make sure your Windows is updated, your audio drivers updated, check that your DirectX is up to date. I’m not sure, very weird one.

Non of these helped unfortunately :roll_eyes:. I’m getting the same errors.

Have you installed all the required SDKs?

Run the Unreal Engine Prerequisite installer (UERootLocation]\Engine\Extras\Redist\en-us).

Open Visual Studio Installer and click Modify Installation and make sure you have these.

Worksloads:

  • Game Development with C++

Individual Components:

  • Windows 10 SDK (10.0.19041.0)
  • C++ profiling tools
  • C++ AddressSanitizer (optional)

If that doesn’t work then I’m all out of ideas :man_shrugging:

@Ari_Epic I’ve checked everything. Everything is installed. But still, not working :man_facepalming:

DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_PhysicalSpeakers, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x23, 0xe0, 0xc0, 0xff, 0xee, 0x7f, 0x0e, 3);
DEFINE_PROPERTYKEY(PKEY_AudioEngine_DeviceFormat, 0xf19f064d, 0x82c, 0x4e27, 0xbc, 0x73, 0x68, 0x82, 0xa1, 0xbb, 0x8e, 0x4c, 0); 
DEFINE_PROPERTYKEY(PKEY_AudioEngine_OEMFormat, 0xe4870e26, 0x3cc5, 0x4cd2, 0xba, 0x46, 0xca, 0xa, 0x9a, 0x70, 0xed, 0x4, 3);

These Keys are all defined, but I am getting this weird error…

In my win32 project, add include <initguid.h>。That solves the problem perfectly.

include <initguid.h>