YetiTech-Studios / UE4GameLiftClientSDK

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

Issues with the last gamelift sdk #15

Open NorsfellRegis opened 5 years ago

NorsfellRegis commented 5 years ago

Hi,

Thank you very much for this plugin !

I try to update your project with the last Gamelift C++ SDK. I have followed this steps:

mkdir out cd out cmake -G "Visual Studio 15 2017 Win64" .. -DCMAKE_BUILD_TYPE=Release -DBUILD_ONLY="gamelift"

When builded these files are generated:

out\bin\Release\aws-cpp-sdk-gamelift.dll out\bin\Release\aws-cpp-sdk-core.dll out\aws-cpp-sdk-gamelift\Release\aws-cpp-sdk-gamelift.lib out\aws-cpp-sdk-core\Release\aws-cpp-sdk-core.lib

I have added this files to my UE4 project in the plugin folder. All seems ok but when I try to compile I have this errors: 2> [4/7] Module.AWSCore.cpp 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(10): error C2039: 'clock_t': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(10): error C2873: 'clock_t': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(12): error C2039: 'asctime': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(12): error C2873: 'asctime': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(12): error C2039: 'clock': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(12): error C2873: 'clock': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(12): error C2039: 'ctime': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(12): error C2873: 'ctime': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(13): error C2039: 'difftime': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(13): error C2873: 'difftime': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(13): error C2039: 'gmtime': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(13): error C2873: 'gmtime': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(13): error C2039: 'localtime': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(13): error C2873: 'localtime': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(14): error C2039: 'mktime': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(14): error C2873: 'mktime': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(14): error C2039: 'strftime': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(14): error C2873: 'strftime': symbol cannot be used in a using-declaration 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(14): error C2039: 'time': is not a member of 'global namespace'' 2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\INCLUDE\ctime(14): error C2873: 'time': symbol cannot be used in a using-declaration 2>UnrealBuildTool : error : UBT ERROR: Failed to produce item: D:\Projects\Unreal\DedicatedServerDemos\Game\Plugins\GameLiftClientSDK\Intermediate\Build\Win64\UE4Editor\Development\AWSCore\UE4Editor-AWSCore.lib

Have I missed something ? It should be awesome if you can share the steps to compile the client.

Best regards, Régis

Yakim3396 commented 5 years ago

Hi, in December I did the same, but I received similar errors, if you know how to solve them, please let me know.

chris-gong commented 5 years ago

This isn't really an issue with the client sdk, moreso a question on how to add the gameliftserver sdk to a project. Are you adding the whole gameliftserversdk folder to the plugins folder? or just the binary files? Regardless, I think this should be closed since it's not related to this repository technically.

cyphusx commented 4 years ago

This is caused by the compiler finding aws/core/platform/Time.h instead of the ctime header (time.h). I found someone else had this issue with another project (https://github.com/aws/aws-sdk-cpp/issues/1041), and their solution worked for me, though it's not ideal and I'm sure there must be a better way (https://github.com/aws/aws-sdk-cpp/pull/878)

chris-gong commented 4 years ago

Looking back, I completely misunderstood this issue when I first read it. As I am now updating the dll and lib files as well as the include files to match a more recent version of the aws cpp sdk (1.7.x), I come across this issue while building the plugin. The only solution at this point is to rename the Time.h file located in the "<path-to-aws-cpp-sdk-core\include\aws\core\platform" directory to AwsTime.h. Note that this directory corresponds to the "GameLiftClientSDK\Source\AWSCore\Public\aws\core\platform" directory in the plugin. Technically, this plugin already renamed the file and some include statements. For anyone planning to update the dll/lib files as well as the header files, make sure to rename the file in the cloned aws cpp sdk repository. And before calling cmake, make sure that the following include statement is changed from #include <aws/core/platform/Time.h> to #include <aws/core/platform/AwsTime.h> in these files:

<path-to-aws-cpp-sdk-core\source\platform\linux-shared\Time.cpp
<path-to-aws-cpp-sdk-core\source\platform\android\Time.cpp
<path-to-aws-cpp-sdk-core\source\platform\windows\Time.cpp
<path-to-aws-cpp-sdk-core\source\utils\DateTimeCommon.cpp

Thank you @cyphusx for the solution. I plan on adding updated steps to updating the dll/lib files in the readme soon.

heberuriegas commented 4 years ago

Same issue here adding compiled lib and dll files in order to use s3.