o3de / o3de-extras

Other
61 stars 63 forks source link

Bug Report: MultiplayerTemplate failed on export launcher for windows #788

Open ralphsobremonte22 opened 1 day ago

ralphsobremonte22 commented 1 day ago

Describe the bug

================================================================== [INFO] root: MTPSModule.cpp

[INFO] root: MTPS.Server.vcxproj -> C:\Users\RalphSobremonteL\O3DE\Projects\MTPS\build\launcher\lib\release\MTPS.Server.lib

[INFO] root: Copying MTPS.ServerLauncher runtime dependencies to output...

[INFO] root: -- Copying "C:/Users/RalphSobremonteL/.o3de/3rdParty/packages/vulkan-validationlayers-1.3.261-rev1-windows/vulkan-validationlayers/lib/release/VkLayer_khronos_validation.json" to "C:/Users/RalphSobremonteL/O3DE/Projects/MTPS/build/launcher/bin/release/"...

[INFO] root: -- Copying "C:/Users/RalphSobremonteL/.o3de/3rdParty/packages/vulkan-validationlayers-1.3.261-rev1-windows/vulkan-validationlayers/lib/release/VkLayer_khronos_validation.dll" to "C:/Users/RalphSobremonteL/O3DE/Projects/MTPS/build/launcher/bin/release/"...

[INFO] root: -- Copying "C:/Users/RalphSobremonteL/.o3de/3rdParty/packages/PhysX-4.1.2.29882248-rev8-windows/PhysX/shared//bin/PhysXDevice64.dll" to "C:/Users/RalphSobremonteL/O3DE/Projects/MTPS/build/launcher/bin/release/"...

[INFO] root: -- Copying "C:/Users/RalphSobremonteL/.o3de/3rdParty/packages/PhysX-4.1.2.29882248-rev8-windows/PhysX/shared//bin/PhysXGpu_64.dll" to "C:/Users/RalphSobremonteL/O3DE/Projects/MTPS/build/launcher/bin/release/"...

[INFO] root: Building Custom Rule E:/O3DE/CMakeLists.txt

[INFO] root: unity_0_cxx.cxx

[INFO] root: Creating library C:/Users/RalphSobremonteL/O3DE/Projects/MTPS/build/launcher/lib/release/MTPS.ServerLauncher.lib and object C:/Users/RalphSobremonteL/O3DE/Projects/MTPS/build/launcher/lib/release/MTPS.ServerLauncher.exp

[INFO] root: unity_0_cxx.obj : error LNK2019: unresolved external symbol CreateModuleClass_Gem_MTPS_Server referenced in function CreateStaticModules [C:\Users\RalphSobremonteL\O3DE\Projects\MTPS\build\launcher\o3de\MTPS.ServerLauncher.vcxproj]

[INFO] root: C:\Users\RalphSobremonteL\O3DE\Projects\MTPS\build\launcher\bin\release\MTPS.ServerLauncher.exe : fatal error LNK1120: 1 unresolved externals [C:\Users\RalphSobremonteL\O3DE\Projects\MTPS\build\launcher\o3de\MTPS.ServerLauncher.vcxproj]

[INFO] root:

[INFO] root: Terminating process 'cmake' with PID(7084)

[INFO] root: process 'cmake' with PID(7084) terminated with exit code 1

Error building the monolithic launcher(s).

Steps to reproduce Steps to reproduce the behavior: Export Launcher to Windows

Expected behavior Produce an executable

Actual behavior Failed to produce export launcher

Found in Branch o3de main

Desktop/Device (please complete the following information): Windows 10

ralphsobremonte22 commented 1 day ago

Solution from Gene [Amazon] from Discord.

Needs to update MTPSModule.cpp

if defined(AZ_MONOLITHIC_BUILD)

#if defined(O3DE_GEM_NAME)
    AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Client), MTPS::MTPSModule)
#else
    AZ_DECLARE_MODULE_CLASS(Gem_MTPS_Client, MTPS::MTPSModule)
#endif
#if defined(O3DE_GEM_NAME)
    AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Server), MTPS::MTPSModule)
#else
    AZ_DECLARE_MODULE_CLASS(Gem_MTPS_Server, MTPS::MTPSModule)
#endif

endif

if defined(O3DE_GEM_NAME)

AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME), MTPS::MTPSModule)

else

AZ_DECLARE_MODULE_CLASS(Gem_MTPS, MTPS::MTPSModule)

endif