UE4GameLiftClientSDK icon indicating copy to clipboard operation
UE4GameLiftClientSDK copied to clipboard

Issues with the last gamelift sdk

Open NorsfellRegis opened this issue 6 years ago • 5 comments

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

NorsfellRegis avatar Jan 09 '19 20:01 NorsfellRegis

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

Yakim3396 avatar Jan 13 '19 19:01 Yakim3396

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.

chris-gong avatar Feb 09 '19 16:02 chris-gong

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)

cyphusx avatar Aug 29 '19 08:08 cyphusx

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.

chris-gong avatar Sep 12 '19 07:09 chris-gong

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

heberuriegas avatar Oct 31 '19 06:10 heberuriegas