The UE 4 installation seems to have the files (C:\Program Files\Epic Games\UE_4.20\Engine\Source\ThirdParty\Windows\DirectX) but creating the environment variable with that value still produces the same error. If you use the directory with forward slashes directly in the code instead of $(DXSDK_DIR) then it works as a temporary workaround.