YetiTech-Studios / UE4GameLiftClientSDK

Gamelift Client SDK for Unreal Engine 4.
MIT License
79 stars 41 forks source link

Fixed build issues (Windows and Linux) #21

Open chris-gong opened 4 years ago

chris-gong commented 4 years ago

Hi @ryanjon2040 really sorry to bother you again. In my last pull request I realized I may have accidentally removed some very important include statements that I just readded. Thank you for your patience.

chris-gong commented 4 years ago

I realized after updating the DLL and lib files that they now depend on some other DLL and lib files, but I'm having trouble linking those dependencies. I have added those dependencies to the third-party/win64 folder.

chris-gong commented 4 years ago

Made some changes to further fix compiler issues related to updating the aws sdk lib/dll files. Going to add a couple more commits and do some testing to finish it off. @ryanjon2040 @YetiTechStudios is there any way I could be added to this organization? I would love to continue helping out with the development of this plugin as my friend and I continue to make gamelift tutorials.

chris-gong commented 4 years ago

Confirmed that the client sdk works for windows aka it builds/compiles successfully. Now going to test Linux.

chris-gong commented 4 years ago

Can confirm that the client sdk builds for both windows and linux. Going to add stuff to https://github.com/chris-gong/gamelift-example-ue4 to check that everything works with the GameLift servers.

YetiTechStudios commented 4 years ago

Hi @chris-gong We've sent you an invite to join this organization. 😃

chris-gong commented 4 years ago

Currently, the sdk in this pull request is not testable in the unreal engine editor so the game would have to be packaged to test the client sdk. I only did this because this is how the gamelift server sdk does it, but I am thinking of reverting it back to where the client sdk was testable in the unreal engine editor.

chris-gong commented 4 years ago

It seems that after updating the Linux library files, that I am missing two .so dependencies. These include libcrypto.so and libssl.so

chris-gong commented 4 years ago

Because I am unable to get it working for linux, at least to cross compile from windows, I will keep it so that the client is not testable in the engine editor. My objective now is to make sure that I can package a functioning windows client without the gamelift client dependencies from interfering with a linux server build uploaded to gamelift.

Wylie-Modro commented 4 years ago

Hey @chris-gong,

In the pursuit of solving this issue I cloned your branch and build it on/for windows x64 without too many issues for the base functionality.

But if I try to use constructors like: Aws::GameLift::Model::CreateGameSessionQueueRequest(), Aws::GameLift::Model::GameSessionQueueDestination::GameSessionQueueDestination(), or Aws::Vector the build fails with unresolved external symbols:

error LNK2019: unresolved external symbol "__declspec(dllimport) void * __cdecl Aws::Malloc(char const *,unsigned __int64)" (__imp_?Malloc@Aws@@YAPEAXPEBD_K@Z) referenced in function "private: bool __cdecl std::vector<class Aws::GameLift::Model::GameSessionQueueDestination,class Aws::Allocator<class Aws::GameLift::Model::GameSessionQueueDestination> >::_Buy(unsigned __int64)" (?_Buy@?$vector@VGameSessionQueueDestination@Model@GameLift@Aws@@V?$Allocator@VGameSessionQueueDestination@Model@GameLift@Aws@@@4@@std@@AEAA_N_K@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl Aws::Free(void *)" (__imp_?Free@Aws@@YAXPEAX@Z) referenced in function "public: __cdecl std::vector<class Aws::GameLift::Model::GameSessionQueueDestination,class Aws::Allocator<class Aws::GameLift::Model::GameSessionQueueDestination> >::~vector<class Aws::GameLift::Model::GameSessionQueueDestination,class Aws::Allocator<class Aws::GameLift::Model::GameSessionQueueDestination> >(void)" (??1?$vector@VGameSessionQueueDestination@Model@GameLift@Aws@@V?$Allocator@VGameSessionQueueDestination@Model@GameLift@Aws@@@4@@std@@QEAA@XZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Aws::GameLift::Model::GameSessionQueueDestination::GameSessionQueueDestination(void)" (__imp_??0GameSessionQueueDestination@Model@GameLift@Aws@@QEAA@XZ) referenced in function "public: void __cdecl UT_GameInstance::StartQuickPlaySearch(void)" (?StartQuickPlaySearch@UT_GameInstance@@QEAAXXZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Aws::GameLift::Model::GameSessionQueueDestination::SetDestinationArn(char const *)" (__imp_?SetDestinationArn@GameSessionQueueDestination@Model@GameLift@Aws@@QEAAXPEBD@Z) referenced in function "public: void __cdecl UT_GameInstance::StartQuickPlaySearch(void)" (?StartQuickPlaySearch@UT_GameInstance@@QEAAXXZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Aws::GameLift::Model::GameSessionQueueDestination::~GameSessionQueueDestination(void)" (__imp_??1GameSessionQueueDestination@Model@GameLift@Aws@@QEAA@XZ) referenced in function "public: __cdecl std::_Uninitialized_backout_al<class Aws::GameLift::Model::GameSessionQueueDestination *,class Aws::Allocator<class Aws::GameLift::Model::GameSessionQueueDestination> >::~_Uninitialized_backout_al<class Aws::GameLift::Model::GameSessionQueueDestination *,class Aws::Allocator<class Aws::GameLift::Model::GameSessionQueueDestination> >(void)" (??1?$_Uninitialized_backout_al@PEAVGameSessionQueueDestination@Model@GameLift@Aws@@V?$Allocator@VGameSessionQueueDestination@Model@GameLift@Aws@@@4@@std@@QEAA@XZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Aws::GameLift::Model::GameSessionQueueDestination::GameSessionQueueDestination(class Aws::GameLift::Model::GameSessionQueueDestination const &)" (__imp_??0GameSessionQueueDestination@Model@GameLift@Aws@@QEAA@AEBV0123@@Z) referenced in function "private: void __cdecl std::vector<class Aws::GameLift::Model::GameSessionQueueDestination,class Aws::Allocator<class Aws::GameLift::Model::GameSessionQueueDestination> >::_Range_construct_or_tidy<class Aws::GameLift::Model::GameSessionQueueDestination const *>(class Aws::GameLift::Model::GameSessionQueueDestination const *,class Aws::GameLift::Model::GameSessionQueueDestination const *,struct std::forward_iterator_tag)" (??$_Range_construct_or_tidy@PEBVGameSessionQueueDestination@Model@GameLift@Aws@@@?$vector@VGameSessionQueueDestination@Model@GameLift@Aws@@V?$Allocator@VGameSessionQueueDestination@Model@GameLift@Aws@@@4@@std@@AEAAXPEBVGameSessionQueueDestination@Model@GameLift@Aws@@0Uforward_iterator_tag@1@@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Aws::GameLift::Model::CreateGameSessionQueueRequest::CreateGameSessionQueueRequest(void)" (__imp_??0CreateGameSessionQueueRequest@Model@GameLift@Aws@@QEAA@XZ) referenced in function "public: void __cdecl UT_GameInstance::StartQuickPlaySearch(void)" (?StartQuickPlaySearch@UT_GameInstance@@QEAAXXZ)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl Aws::GameLift::Model::CreateGameSessionQueueRequest::~CreateGameSessionQueueRequest(void)" (__imp_??1CreateGameSessionQueueRequest@Model@GameLift@Aws@@UEAA@XZ) referenced in function "public: void __cdecl UT::StartQuickPlaySearch(void)" (?StartQuickPlaySearch@UT_GameInstance@@QEAAXXZ)

Did you miss some header files potentially?

Just a note: the call to Aws::Vector throwing the Malloc and Free unresolved external symbols also occurs on the version of this plugin that you used for your tutorial. This is at the core of this issue that I posted.

Any help on this would be very much appreciated. Cheers!

chris-gong commented 4 years ago

Hi @wylie-modro I will take a look tonight.

Wylie-Modro commented 4 years ago

@chris-gong Did you get anytime to look into this? Posted on the AWS GameTech forum as well, but seem to be stuck on it.

chris-gong commented 4 years ago

Hey @wylie-modro, could you play around with the latest version of this pull request? It seems that I was able to get it working when you build and package in Development Client mode for Windows. It doesn't seem to work for Linux but since the code only compiles in client mode, it shouldn't conflict with a Linux server build. However when packaging the game in client mode, make sure to add the compiled DLLs from plugin/binaries to Windowsclientbuild/game/binaries

SalahAdDin commented 4 years ago

What's about this?