Skip to main content

Quickstart: C++ for Linux

Get started with the PlayFab Client library for C++. Follow steps to install the package and try out example code for a basic task. This quickstart helps you make your first PlayFab API call in the using the Client library for C++. This quickstart was written using Ubuntu 18.04 LTS. API reference documentation | Library source code

Requirements

Linux C++ Project Setup

  1. Install the following (sudo apt-get install ____ on Ubuntu):
    • g++
    • gdb
    • make
    • cmake
    • libjsoncpp-dev
    • libcurl4-openssl-dev
    • git-all
  2. Clone the PlayFab cross-platform (CPP) SDK into your project folder.
To verify that your installation is correct. Create a main.cpp and insert the “Hello World” code shown below.
If you’re using an IDE, make sure to:
  • Add the following folders to your sources:
    • XPlatCppSdk/cppsdk/source/playfab
  • Add the following folders to your include directories:
    • XPlatCppSdk/cppsdk
    • XPlatCppSdk/cppsdk/include
  • Link the following libraries:
    • jsoncpp
    • curl
    • pthread
Otherwise, create a file named CMakeLists.txt and copy the build commands shown below.
  • Build and run the project from inside your IDE, or open a Terminal prompt and run:
    • cmake .
    • make
    • ./PlayFab_Test

Set up your first API call

This guide provides the minimum steps to make your first PlayFab API call, without any GUI or on-screen feedback. Confirmation is performed using a console print statement. First, replace the contents of main.cpp with the content shown below.

Finish and execute

  1. Build and run the project inside your IDE, or open Terminal and run:
    • ./PlayFab_Test
  2. When it loads, the following text is displayed:
    • “Congratulations, you made your first successful API call!”
  3. Start making other API calls, and build your title.
Last modified on August 10, 2026