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 RTC SDK features.
This page shows how to compile, configure, and run the RTC 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.
-
A camera and a microphone
-
A valid Agora account and project. Please refer to Agora account management for details.
-
Installed Git
Project setup
Get the sample project
-
Run the following command to clone the repository locally:
git clone git@github.com:AgoraIO/API-Examples.gitThis repository contains sample projects for all native platforms of Agora RTC SDK. The API usage examples for Windows are located under
/windows. -
Integrate SDK and install dependencies
Run
/APIExample/installThirdParty.batto automatically integrate the SDK, download dependencies, and configure the environment. -
Set App ID and Token
Open the
/APIExample/APIExample/stdafx.hfile 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
-
Open the file
/APIExample/APIExample.slnin Visual Studio. -
Click Start compiling.
-
After compilation is complete, you see the following window on your device:
-
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.
-
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.
