PopcornFX / O3DEPopcornFXPlugin

PopcornFX plugin for O3DE
https://www.popcornfx.com/
Other
13 stars 12 forks source link

Release Mode Linker Errors #68

Closed AMZN-Gene closed 1 year ago

AMZN-Gene commented 1 year ago

PopcornFx fails to compile due to linker errors when building the GameLauncher in release mode

Repro steps

  1. Release mode compile the MultiplayerSample (or any game using this PopcornFx plugin)
    cmake --build .\build\windows\ --target MultiplayerSample.GameLauncher --config release -- /m

Expected Behavior The game compiles

Actual Behavior PopcornFX plugin fails to compile due to linker errors

PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static char const * __cdecl PopcornFX::CLog::LogClassToString(class PopcornFX::TGuid<unsigned int >)" (?LogClassToString@CLog@PopcornFX@@SAPEBDV?$TGuid@I@2@@Z) referenced in function "public: virtual void __cdecl PopcornFX::CLogListenerO3DE::Notify(enum PopcornFX::CLog::ELogLeve l,class PopcornFX::TGuid<unsigned int>,char const *)" (?Notify@CLogListenerO3DE@PopcornFX@@UEAAXW4ELogLevel@CLog@2@V?$TGuid@I@2@PEBD@Z) [D:\github\o3de-multiplayersample\build\game\ o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl PopcornFX::CLog::AddGlobalListener(class PopcornFX::TRefPtr<class PopcornFX:: ILogListener>)" (?AddGlobalListener@CLog@PopcornFX@@SAXV?$TRefPtr@VILogListener@PopcornFX@@@2@@Z) referenced in function "void __cdecl PopcornFX::PopcornFX_AddLogListener(void *)" ( ?PopcornFX_AddLogListener@PopcornFX@@YAXPEAX@Z) [D:\github\o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static class PopcornFX::TGuid<unsigned int> __cdecl PopcornFX::CLog::RegisterLogClass(char const
*)" (?RegisterLogClass@CLog@PopcornFX@@SA?AV?$TGuid@I@2@PEBD@Z) referenced in function "bool __cdecl PopcornFX::PopcornStartup(char const *)" (?PopcornStartup@PopcornFX@@YA_NPEBD@Z) [D:\github\o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static bool __cdecl PopcornFX::CLog::UnregisterLogClass(class PopcornFX::TGuid<unsigned int>,char const *)" (?UnregisterLogClass@CLog@PopcornFX@@SA_NV?$TGuid@I@2@PEBD@Z) referenced in function "void __cdecl PopcornFX::PopcornShutdown(void)" (?PopcornShutdown@PopcornFX@@YAXXZ) [ D:\github\o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl PopcornFX::CLog::LogModuleBootMessage(enum PopcornFX::CLog::EModuleBootMode,c lass PopcornFX::TGuid<unsigned int>,char const *)" (?LogModuleBootMessage@CLog@PopcornFX@@SAXW4EModuleBootMode@12@V?$TGuid@I@2@PEBD@Z) referenced in function "bool __cdecl PopcornFX ::PopcornStartup(char const *)" (?PopcornStartup@PopcornFX@@YA_NPEBD@Z) [D:\github\o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj ]
PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl PopcornFX::CThreadStats::RegisterRWLockCreation(void)" (?RegisterRWLockCreati on@CThreadStats@PopcornFX@@SAXXZ) referenced in function "public: __cdecl PopcornFX::PopcornFXIntegration::PopcornFXIntegration(void)" (??0PopcornFXIntegration@PopcornFX@@QEAA@XZ) [ D:\github\o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.Static.lib(unity_4_cxx.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl PopcornFX::CThreadStats::RegisterRWLockCreation(void)" (?RegisterRWLoc kCreation@CThreadStats@PopcornFX@@SAXXZ) [D:\github\o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl PopcornFX::CThreadStats::RegisterRWLockDestruction(void)" (?RegisterRWLockDes truction@CThreadStats@PopcornFX@@SAXXZ) referenced in function "public: virtual __cdecl PopcornFX::CWindManager::~CWindManager(void)" (??1CWindManager@PopcornFX@@UEAA@XZ) [D:\github \o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.Static.lib(unity_4_cxx.obj) : error LNK2001: unresolved external symbol "public: static void __cdecl PopcornFX::CThreadStats::RegisterRWLockDestruction(void)" (?RegisterRW LockDestruction@CThreadStats@PopcornFX@@SAXXZ) [D:\github\o3de-multiplayersample\build\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.lib(unity_0_cxx.obj) : error LNK2019: unresolved external symbol "public: static class PopcornFX::CString __cdecl PopcornFX::CCallContext::ReadStackToString(class PopcornF X::TGuid<unsigned int>)" (?ReadStackToString@CCallContext@PopcornFX@@SA?AVCString@2@V?$TGuid@I@2@@Z) referenced in function "void __cdecl PopcornFX::PrettyFormatAssert_Unsafe(char * ,unsigned int,char const *,char const *,int,char const *,char const *,char const *)" (?PrettyFormatAssert_Unsafe@PopcornFX@@YAXPEADIPEBD1H111@Z) [D:\github\o3de-multiplayersample\bu ild\game\o3de\Code\LauncherUnified\MultiplayerSample.GameLauncher.vcxproj]
PopcornFX.Static.lib(unity_5_cxx.obj) : error LNK2019: unresolved external symbol "public: static void __cdecl PopcornFX::CLog::Log(enum PopcornFX::CLog::ELogLevel,class PopcornFX:: TGuid<unsigned int>,char const *,...)" (?Log@CLog@PopcornFX@@SAXW4ELogLevel@12@V?$TGuid@I@2@PEBDZZ) referenced in function "public: static class PopcornFX::CFileStreamFS_O3DE * __cd ecl PopcornFX::CFileStreamFS_O3DE::Open(class PopcornFX::FileSystemController_O3DE *,class PopcornFX::TRefPtr<class

Workaround 1) Open .o3de\3rdParty\packages\PopcornFX-2.17.2-O3DE-windows\FindPopcornFX.cmake 2) Replace line 20 with: _set(POPCORNFX_LIBRARY_SUFFIX $<IF:$,_d,$<IF:$,_r,_r>>${CMAKE_STATIC_LIBRARYSUFFIX})

TheOneAbis commented 1 year ago

Alternate Workaround

as outlined in issue #66 , one can add the define in the Code folder's CMakeLists.txt. Check the issue link for more details.

Also this issue has been resolved in this PR #67 , though it was mentioned in the issue comments that the better fix would be to add this change in FindPopcornFX.cmake.

AMZN-Gene commented 1 year ago

Closed

AMZN-Gene commented 1 year ago

Duplicate #67