Cant build PhotonDemoParticle UE4

Hi.

When trying to build a project, I get the error like below. I'm using EU 4.26. I kindly ask for help.


Build started...
1>
Build started: Project: PhotonDemoParticle, Configuration: DebugGame_Editor x64
1>Building PhotonDemoParticleEditor...
1>Using Visual Studio 2019 14.29.30133 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>[Upgrade]
1>[Upgrade] Using backward-compatible build settings. The latest version of UE4 sets the following values by default, which may require code changes:
1>[Upgrade] bLegacyPublicIncludePaths = false => Omits subfolders from public include paths to reduce compiler command line length. (Previously: true).
1>[Upgrade] ShadowVariableWarningLevel = WarningLevel.Error => Treats shadowed variable warnings as errors. (Previously: WarningLevel.Warning).
1>[Upgrade] PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs => Set in build.cs files to enables IWYU-style PCH model. See https://docs.unrealengine.com/en-US/Programming/BuildTools/UnrealBuildTool/IWYU/index.html. (Previously: PCHUsageMode.UseSharedPCHs).
1>[Upgrade] Suppress this message by setting 'DefaultBuildSettings = BuildSettingsVersion.V2;' in PhotonDemoParticleEditor.Target.cs, and explicitly overriding settings that differ from the new defaults.
1>[Upgrade]
1>Building 5 actions with 128 processes...
1> [1/5] LoadBalancingListener.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winnt.h(611): warning C4005: 'TEXT': macro redefinition
1> D:\UnrealEngine\UE_4.26\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1082): note: see previous definition of 'TEXT'
1>D:\Photon-Unreal-SDK_DemoParticle-UE4\Source\PhotonDemoParticle\demo_particle_common\LoadBalancingListener.cpp(84): error C2660: 'ExitGames::LoadBalancing::Client::connect': function does not take 2 arguments
1> D:\Photon-Unreal-SDK_DemoParticle-UE4\Source\Photon\LoadBalancing-cpp/inc/Client.h(35): note: see declaration of 'ExitGames::LoadBalancing::Client::connect'
1> [2/5] PhotonLBClient.cpp
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winnt.h(611): warning C4005: 'TEXT': macro redefinition
1> D:\UnrealEngine\UE_4.26\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1082): note: see previous definition of 'TEXT'
1>D:\Photon-Unreal-SDK_DemoParticle-UE4\Source\PhotonDemoParticle\PhotonLBClient.cpp(31): error C2660: 'ExitGames::LoadBalancing::Client::connect': function does not take 3 arguments
1> D:\Photon-Unreal-SDK_DemoParticle-UE4\Source\Photon\LoadBalancing-cpp/inc/Client.h(35): note: see declaration of 'ExitGames::LoadBalancing::Client::connect'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(45,5): error MSB3073: The command "D:\UnrealEngine\UE_4.26\Engine\Build\BatchFiles\Build.bat PhotonDemoParticleEditor Win64 DebugGame -Project="D:\Photon-Unreal-SDK_DemoParticle-UE4\PhotonDemoParticle.uproject" -WaitMutex -FromMsBuild" exited with code 6.
1>Done building project "PhotonDemoParticle.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Comments

  • Hi @Lukson.

    I assume that you are trying to use the latest Photon Client SDK version 5.0.0.2. Is that correct?
    The demo is still expecting the Photon Client APIs from version 4.1.16.0-4.1.16.7.
    The latest 4.1.16.something releases for all platforms are still available in our download section (you can find the download links right next to the ones for the latest release under "older versions"). The Unreal demo should work fine as is with those versions.

    Line 31 in PhotonLBClient.cpp that is mentioned in the error message reads like this:
    mpClient->connect(ExitGames::LoadBalancing::AuthenticationValues().setUserID(ExitGames::Common::JString(L"UR") + GETTIMEMS()), ExitGames::Common::JString(L"UR") + GETTIMEMS(), TCHAR_TO_UTF8(*serverAddress));
    

    To make it compile with the latest SDK and still exhibit the same functionality like before, you can change it to the following code:
    mpClient->connect(ExitGames::LoadBalancing::ConnectOptions().setAuthenticationValues(ExitGames::LoadBalancing::AuthenticationValues().setUserID(ExitGames::Common::JString(L"UR") + GETTIMEMS())).setUsername(ExitGames::Common::JString(L"UR") + GETTIMEMS()).setServerAddress(TCHAR_TO_UTF8(*serverAddress)));
    

    Accordingly you need to change line 84 in LoadBalancingListener.cpp from
    mpLbc->connect(AuthenticationValues().setUserID(JString()+GETTIMEMS()), userName);
    
    to
    mpLbc->connect(ConnectOptions().setAuthenticationValues(AuthenticationValues().setUserID(JString()+GETTIMEMS())).setUsername(userName));
    
    to make it work with the latest SDK.
  • I'm using photon-windows-sdk_v5-0-0-0. That was exactly the problem. After the suggested changes, I was able to build the project. @Kaiserludi, thank you very much for your help!

    Cheers