Error compiling Photon-Unreal-SDK_DemoParticle-UE4 with 5.0.2 sdk

overexit
overexit
edited February 1 in Native

Hi, am trying out photon sample with UE4.27, error compiling after applying the patch manually


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 11 actions with 8 processes...

1> [1/11] PhotonDemoParticle.rc

1> [2/11] PCH.PhotonDemoParticle.cpp

1> [3/11] PhotonDemoParticle.init.gen.cpp

1> [4/11] PhotonDemoParticle.cpp

1> [5/11] LoadBalancingListener.cpp

1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h(603): warning C4005: 'TEXT': macro redefinition

1> C:\Library\Epic Games\UE_4.27\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1085): note: see previous definition of 'TEXT'

1>D:\Data\Desktop\Network\Photon\Photon-Unreal-SDK_DemoParticle-UE4\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:\Data\Desktop\Network\Photon\Photon-Unreal-SDK_DemoParticle-UE4\Photon-Unreal-SDK_DemoParticle-UE4\Source\Photon\LoadBalancing-cpp/inc/Client.h(36): note: see declaration of 'ExitGames::LoadBalancing::Client::connect'

1> [6/11] PhotonLBClient.cpp

1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h(603): warning C4005: 'TEXT': macro redefinition

1> C:\Library\Epic Games\UE_4.27\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1085): note: see previous definition of 'TEXT'

1>D:\Data\Desktop\Network\Photon\Photon-Unreal-SDK_DemoParticle-UE4\Photon-Unreal-SDK_DemoParticle-UE4\Source\PhotonDemoParticle\PhotonLBClient.cpp(31): error C2660: 'ExitGames::LoadBalancing::Client::connect': function does not take 3 arguments

1> D:\Data\Desktop\Network\Photon\Photon-Unreal-SDK_DemoParticle-UE4\Photon-Unreal-SDK_DemoParticle-UE4\Source\Photon\LoadBalancing-cpp/inc/Client.h(36): note: see declaration of 'ExitGames::LoadBalancing::Client::connect'

1> [7/11] Console.cpp

1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h(603): warning C4005: 'TEXT': macro redefinition

1> C:\Library\Epic Games\UE_4.27\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1085): note: see previous definition of 'TEXT'

1> [8/11] PhotonLBClient.gen.cpp

1>C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h(603): warning C4005: 'TEXT': macro redefinition

1> C:\Library\Epic Games\UE_4.27\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1085): note: see previous definition of 'TEXT'

1>C:\Compiler\VStudio2019Pro\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets(51,5): error MSB3073: The command ""C:\Library\Epic Games\UE_4.27\Engine\Build\BatchFiles\Rebuild.bat" PhotonDemoParticleEditor Win64 Development -Project="D:\Data\Desktop\Network\Photon\Photon-Unreal-SDK_DemoParticle-UE4\Photon-Unreal-SDK_DemoParticle-UE4\PhotonDemoParticle.uproject" -WaitMutex -FromMsBuild" exited with code -1.

1>Done building project "PhotonDemoParticle.vcxproj" -- FAILED.

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Answers

  • Hi @overexit.


    Please see my answer at https://forum.photonengine.com/discussion/comment/57593/#Comment_57593 for how to fix those build errors.

  • Thanks, it can compile but it doesn't link.

    2>Building 2 actions with 8 processes...

    2> [1/2] UE4Editor-PhotonDemoParticle.dll

    2>LINK : fatal error LNK1181: cannot open input file 'D:\Data\Desktop\Network\Photon\Photon-Unreal-SDK_DemoParticle-UE4\Photon-Unreal-SDK_DemoParticle-UE4\Source\Photon\lib\Windows\Common-cpp_vc14_release_windows_md_x64.lib'

    This file is in Photon\Common-cpp\lib instead.

    This really doesn't inspire a lot of confidence when the sample project fails to run when I see the v5 SDK is out for some months already. First thing is downloading the SDK already causing some confusion, when downloading the Unreal SDK, we are only present with this demo.

  • Hi @overexit.


    2>LINK : fatal error LNK1181: cannot open input file 'D:\Data\Desktop\Network\Photon\Photon-Unreal-SDK_DemoParticle-UE4\Photon-Unreal-SDK_DemoParticle-UE4\Source\Photon\lib\Windows\Common-cpp_vc14_release_windows_md_x64.lib'


    This file is in Photon\Common-cpp\lib instead.


    Well, you have just pointed out the source of the error yourself: You did not copy the libs into the correct subfolder like explained at https://doc.photonengine.com/en-us/realtime/current/getting-started/unreal-engine. You either need to copy them into the location where the demo project expects them or laternatively modify the demos .Build.cs files to look for them at the location to which you have copied them.


    First thing is downloading the SDK already causing some confusion, when downloading the Unreal SDK, we are only present with this demo.

    What do you mean by "downloading the Unreal SDK"? When you navigate to the SDKs section of the website and select 'Unreal Engine', it clearly says that there is no separate SDK for Unreal, because Unreal does not require a special SDK, but works just fine with the standard C++ SDKs:

    All C++ based Photon SDKs are compatible with the UNREAL ENGINE off the shelf!

    Find the SDKs you can gear it up with linked to below.


  • This is the folder of extracted SDK, I don't see a lib folder. All the libs are inside the subfolder. Am I supposed to move your sdk files around?



    This is the page it shows after I click on the windows SDK in the unreal page. Do I see a download link to the SDK?

    I'm trying to evaluate the sdk, but these little issues don't help.

  • Hi @overexit.


    Am I supposed to move your sdk files around?

    Yes. The demo project expects the libs to be in the locations that are shown in the Sample folders layout at https://doc.photonengine.com/en-us/realtime/current/getting-started/unreal-engine, so the Windows libs need to be copied into Photon/libs/Windows. Note that the demo only requires the libs from the Common-cpp, Photon-cpp and LoadBalancing-cpp folder, as it does not use anything from Chat-cpp or PhotonVoice-cpp.


    This is the page it shows after I click on the windows SDK in the unreal page. Do I see a download link to the SDK?

    I'm trying to evaluate the sdk, but these little issues don't help.

    You screenshot is exactly from the page that I quoted in my previous reply. As you can read on your screenshot, it says "All C++ based Photon SDKs are compatible with the UNREAL ENGINE off the shelf! Find the SDKs you can gear it up with linked to below."

    After that it gives you a list of links to the downloads of the SDKs for the various platforms that are supported by Unreal and Photon, including Windows. IMHO this page makes it very clear that there is no separate SDK for Unreal, because the linked SDKs work just fine with Unreal.