Skip to main content

Setup

info

The GameAnalytics C++ SDK code is open-source. Please check out our github repo.

Supported platforms

The C++ SDK supports following platforms:

  • MacOS
  • Windows (32-bit and 64-bit)
  • HTML5
  • Linux (tested on Ubuntu 16.04),
  • UWP
  • Tizen.

Requirements for building the code

  • python (2.7 or higher)
  • cmake (will be automatically downloaded by the script if you don't have it)
  • XCode (for Mac) or Visual Studio 2015 or newer + VS Common Tools (for Windows)

Build

To start a build for all supported build targets simply call the build script for your platform:

  • build.sh for Mac
  • build.bat for Windows

This will build all targets and the first time it's ran it will also install CMake and Tizen SDK.

info

If you are using Tizen the script must be run as an administrator.

tip

By default the build script tries to use Visual Studio 2017. To use Visual Studio 2015 call build.bat -v 2015.

Call either command with a -h parameter to display the usage of the script and it will list all available targets.

To build just a specific target call command with argument -t TARGET (available targets can be shown calling with -h argument).

How to develop / contribute

If you wish to develop or bug-fix features for the SDK, you can use the generated project files to work with.

They will be generated under build/jenkins/build/[target] after calling the build.sh or build.bat.

After building the SDK from source it is needed to link the resulting static library GameAnalytics.lib (Windows) or GameAnalytics.a (Mac) inside your own project where you want to use the SDK.

You also need to link to the following dependencies for the following platforms:

Windows 32-bit

Depending on what version of visual studio you need to link the specified libraries:

  • libcurl
  • libeay32
  • ssleay32

Here are some examples where the libraries would be located, where vcXXX would be the visual studio you have build the project for (e.g vc140 for Visual Studio 2017)

    source/dependencies/curl/lib/win32/vcXXX_x86_release/libcurl.lib
source/dependencies/openssl/1.0.2h/libs/win32/vcXXX_x86_release/libeay32.lib
source/dependencies/openssl/1.0.2h/libs/win32/vcXXX_x86_release/ssleay32.lib

Windows 64-bit

If you are bulding for x64 you will have to link the same libraries but built for x64:

    source/dependencies/curl/lib/win64/vcXXX_x64_release/libcurl.lib
source/dependencies/openssl/1.0.2h/libs/win64/vcXXX_x64_release/libeay32.lib
source/dependencies/openssl/1.0.2h/libs/win64/vcXXX_x64_release/ssleay32.lib

OSX

For MacOS you will need to link with the following libraries:

source/dependencies/curl/lib/osx/libcurl.a
source/dependencies/openssl/1.0.2h/libs/osx/libcrypto.a
source/dependencies/openssl/1.0.2h/libs/osx/libssl.a

Additionally you need to link the following frameworks:

framework CoreFoundation
framework Foundation
framework CoreServices

Linux

source/dependencies/curl/lib/[linux_x64|linux_x86]/libcurl.a
source/dependencies/openssl/1.0.2h/libs/[linux_x64|linux_x86]/libcrypto.a
source/dependencies/openssl/1.0.2h/libs/[linux_x64|linux_x86]/libssl.a

Include Directory

Make sure the following header is accesible from your include paths (either add source/GameAnalytics to your include paths or copy the header inside your project):

  • source/gameanalytics/GameAnalytics.h

Swift (Mac)

If you are using Swift for a Mac application copy the following files into your project:

  • wrapper/GameAnalyticsWrapper.h
  • wrapper/GameAnalyticsWrapper.cpp

You should now be able to call the functions in the wrapper header file inside your swift files.

Configure Tizen IDE

If you are bulding for Tizien OS you will have to add the following privileges to the tizen-manifest.xml file:

  • http://tizen.org/privilege/internet
  • http://tizen.org/privilege/network.get