Compile and run a sample project

Updated

Compile and run a project using Agora SDK

Agora provides Open-source sample projects on GitHub to demonstrate the implementation of basic and advanced Video SDK features.

This page shows how to compile, configure, and run the Video SDK Windows sample project.

Prerequisites

  • A device running Windows 7 or higher.
  • Microsoft Visual Studio 2017 or higher with C++ desktop development support. C++ 11 or above.
  • If you use C# for development, you also need the .NET framework.

Project setup

Get the sample project

  1. Run the following command to clone the repository locally:

    git clone git@github.com:AgoraIO/API-Examples.git

    This repository contains sample projects for all native platforms of Agora Video SDK. The API usage examples for Windows are located under /windows.

  2. Integrate SDK and install dependencies

    Run /APIExample/installThirdParty.bat to automatically integrate the SDK, download dependencies, and configure the environment.

  3. Set App ID and Token

    Open the /APIExample/APIExample/stdafx.h file and fill in the App ID and temporary token you obtained from the Agora Console.

    #define APP_ID     "enter your App ID"
    #define APP_TOKEN  "enter your temporary token"

Run the sample project

  1. Open the file /APIExample/APIExample.sln in Visual Studio.

  2. Click Start compiling.

  3. After compilation is complete, you see the following window on your device:

  4. Choose any demo you want to experience. Taking the Live Broadcasting as an example, enter the channel name you used when generating the temporary token in Channel Name, then click Join Channel.

  5. To test various audio and video interaction use-cases, use the Agora web demo, or install and run the sample project on a second device. Make sure you use the same app ID on both devices. When you join the same channel from two devices, you can see and hear each other.