Search code examples
c++amazon-web-servicesamazon-s3amazon-ec2gamekit

C++ error: no matching function for call to ‘Aws::S3::S3Client::S3Client(Aws::Auth::AWSCredentials


I am trying to install aws gamekit (https://github.com/aws/aws-gamekit/tree/main) on an Ubuntu machine. Have been modifying the code and installation steps where needed but can't seem to get past this. Everytime I run the script to build gamekit, I get the error that there is no matching function for call to ‘Aws::S3::S3Client::S3Client(Aws::Auth::AWSCredentials&, Aws::Client::ClientConfiguration&)’

Here is the code block from the file default_clients.h.

class DefaultClients
    {
    private:
        template <class T>
        static inline T* getDefaultClient(const AccountCredentialsCopy& credentials)
        {
            Aws::Client::ClientConfiguration clientConfig;
            Aws::Auth::AWSCredentials creds;

            clientConfig.region = credentials.region.c_str();
            creds.SetAWSAccessKeyId(credentials.accessKey.c_str());
            creds.SetAWSSecretKey(credentials.accessSecret.c_str());

            return new T(creds, clientConfig);
        }

    public:
        static inline Aws::S3::S3Client* GetDefaultS3Client(const AccountCredentialsCopy& credentials)
        {
            return getDefaultClient<Aws::S3::S3Client>(credentials);
        }

I believe there must be some issue on how I am accessing API, or perhaps a version mismatch

This is the output on the terminal when I run my build scripts.

INFO:root:Running command: ['make'] from directory: /home/red/development/gamekit-ubuntu/aws-gamekit
In file included from /home/red/development/gamekit-ubuntu/aws-gamekit/aws-gamekit-core/include/aws/gamekit/core/utils/sts_utils.h:13,
                 from /home/red/development/gamekit-ubuntu/aws-gamekit/aws-gamekit-core/source/aws/gamekit/core/utils/sts_utils.cpp:5,
                 from /home/red/development/gamekit-ubuntu/aws-gamekit/aws-gamekit-core/CMakeFiles/aws-gamekit-core.dir/Unity/unity_2_cxx.cxx:3:
/home/red/development/gamekit-ubuntu/aws-gamekit/aws-gamekit-core/include/aws/gamekit/core/awsclients/default_clients.h: In instantiation of ‘static T* GameKit::DefaultClients::getDefaultClient(const GameKit::AccountCredentialsCopy&) [with T = Aws::S3::S3Client]’:
/home/red/development/gamekit-ubuntu/aws-gamekit/aws-gamekit-core/include/aws/gamekit/core/awsclients/default_clients.h:52:55:   required from here
/home/red/development/gamekit-ubuntu/aws-gamekit/aws-gamekit-core/include/aws/gamekit/core/awsclients/default_clients.h:46:20: error: no matching function for call to ‘Aws::S3::S3Client::S3Client(Aws::Auth::AWSCredentials&, Aws::Client::ClientConfiguration&)’
   46 |             return new T(creds, clientConfig);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~

I am on an EC2 Ubuntu instance.


Solution

  • The latest C++ SDK doesn't have that constructor:

    https://github.com/aws/aws-sdk-cpp/blob/9a7606a6c98e13c759032c2e920c7c64a6a35264/generated/src/aws-cpp-sdk-s3/include/aws/s3/S3Client.h#L56

    It does seem to be present in the 1.9 releases though:

    https://github.com/aws/aws-sdk-cpp/blob/94d02db44730b0a5cef98ce33deedf43f5333700/aws-cpp-sdk-s3/include/aws/s3/S3Client.h#L80

    Looks like the C++ SDK's API has changed but gamekit hasn't been updated to match.