Sign In Register

How can we help you today?

Start a new topic

Gamesparks CPP SDK 1.1.24 doesn't compile under Android

 In easywsclient\CertificateStore.hpp there is a following definition:

#if (GS_TARGET_PLATFORM == GS_PLATFORM_ANDROID)
			static int numCerts;
			static unsigned char *pCertsEncoded;
			static int *pCertsLength;
#endif

 But in AndroidImplSockets.cpp there is only this:

 

#if defined(__UNREAL__)
int GameSparks::Util::CertificateStore::numCerts = 0;
unsigned char *GameSparks::Util::CertificateStore::pCertsEncoded = NULL;
int *GameSparks::Util::CertificateStore::pCertsLength = NULL;
#endif

 So linker step is failing with following:


 

  C:/Users/user/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/__mutex_base:0: error: undefined reference to 'GameSparks::Util::CertificateStore::pCertsEncoded'
  C:/Users/user/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/__mutex_base:0: error: undefined reference to 'GameSparks::Util::CertificateStore::pCertsLength'
  C:/Users/user/AppData/Local/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/__mutex_base:0: error: undefined reference to 'GameSparks::Util::CertificateStore::numCerts'

Would be nice to fix it :)


1 person has this problem

Update: it's not only doesn't compile, but if unreal define is removed to declare those variables - it doesn't work at all. Because GS SDK now requires SSL cert validation.

I'm basically was stuck at this point because GS stopped working on Android.


To hot fix I've decided just to include COMODO root CA, which you can find here https://support.comodo.com/index.php?/Knowledgebase/Article/View/854/75/root-addtrustexternalcaroot

It's valid for a long time, but eventually would be nice to move to system root certs.


I'm adding a patch file for those in need :)

diff
(3.47 KB)

How can a certificate fix a compilation issue? Can you post a quick instruction?

Piotr, the attached patch file should be self explanatory. You can apply it via https://git-scm.com/docs/git-apply

Did you apply the patch to this repository?:


https://bitbucket.org/gamesparks/gamesparks-cpp-base


I've cloned the repo:


git clone https://bitbucket.org/gamesparks/gamesparks-cpp-base.git


pasted patch.diff inside


and ran


git apply patch.diff


I'm getting the following error:


error: 3rdparty/gamesparks/include/easywsclient/CertificateStore.hpp: No such file or directory

error: 3rdparty/gamesparks/src/easywsclient/AndroidImplSockets.cpp: No such file or directory


Ok, I've managed to change paths and patch succeeded. Finally, it compiled fine. And it's working! A big thanks. I just wonder how game sparks haven't this issue on their site yet. 


1 person likes this

Sorry, indeed "3rdparty/gamesparks" needs to be replaced with "base". I did patch from private repo, and sdk location was a bit off.

Login to post a comment