Last updated: 2023-09-12 10:50:12Download PDF
This document describes how to quickly run the demo for the TRTC Windows C++ SDK.
Install Visual Studio 2017 or later (v2019 is recommended).
Install Qt 5.14.x.
Find the right version of Qt Add-in for your Visual Studio on the Qt website. Download and install it.
Open Visual Studio, in the menu bar, select QT VS Tools > Qt Options > Qt Versions, and add a MSVC compiler.
Copy all the DLL files in
SDK/CPlusPlus/Win64/lib(for 64-bit Windows) to the
releasefolder of the project directory.
debug/releaseis auto-generated after environment configuration in Visual Studio. For 32-bit Windows, copy all the DLL files in
debug/releasefolder of the project directory.
You have signed up for a Tencent Cloud account.
Step 1. Create an application
1. Log in to the TRTC console and select RTC Engine.
2. Click Start now and enter an application name such as
APIExample. If you have already created an application, click link existing application.
3. Add or edit tags according to your actual business needs and click Create application.
Step 2. Get your SDKAppId and SecretKey
After your application created, you can get your SDKAppID and SecretKey on Basic informaction. SDKAppID and SecrentKey is needed for running demo.
Step 3. Download the SDK and demo source code
1. You can download the sample code for 【Windows C++】platform on github.
2. The steps to import SDK can refer to 【Windows C++ SDK import】.
The method for generating
UserSigdescribed in this document involves configuring
SECRETKEYin the client code. In this method,
SECRETKEYmay be easily decompiled and reversed, and if your key is disclosed, attackers can steal your Tencent Cloud traffic. Therefore, this method is suitable only for the local execution and debugging of TRTC-API-Example.
The best practice is to integrate the calculation code of
UserSiginto your server and provide an application-oriented API. When
UserSigis needed, your application can send a request to your server for a dynamic
UserSig. For more information, see How do I calculate
Step 4. Configure demo project files
1.Find and open
SDKAPPID: `0` by default. Set it to the actual `SDKAppID`.
SECRETKEY: left empty by default. Set it to the actual key.
Step 5. Compile and run the demo
QTDemo.slnin the TRTC-API-Example-Qt directory with Microsoft Visual Studio (v2019 is recommended), set up the Qt environment (Qt 5.14 is recommended), and run the project.
1. The demo is running on two devices, but why can't they display the images of each other?
Make sure that the two devices use different
UserID. With TRTC, you cannot use the same
UserIDon two devices simultaneously unless the
2. What are the restrictions of the firewall?
The SDK uses the UDP protocol for audio/video transmission and therefore cannot be used in office networks that block UDP. If you encounter such a problem, see Firewall Restrictions.