Join Tencent RTC at NAB Show 2024 in Las Vegas!
Learn more 
Only  $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Only $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Grab It Now 
Join Tencent RTC at NAB Show 2024 in Las Vegas!
Learn more 
Only  $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Only $9.9! Get 50,000 minutes with our Starter Plan, perfect for your MVP project.
Grab It Now 
RTC Engine
Overview
  • Web
    • Demo Quick Run
    • SDK Quick Start
    • Basic Features
      • Screen Sharing
      • Live Streaming
      • Media Device
      • Audio Volume
      • Set Encoding Profile
      • Detect Network Quality
      • Detect Capabilities
    • Advance Features
      • Enable AI Denoiser
      • Enable Audio Mixer
      • Enable Watermark
      • SEI Message
      • Custom Capturing and Rendering
      • Web Beautification Effects
    • Best Practices
      • Optimize Multi-Person Video Calls
      • Handle Autoplay Restriction
      • Handle Firewall Restriction
    • API List
    • Released Notes
    • Supported Platforms
    • Web FAQs
  • Android
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Setting Video Quality
      • 10.Rotating Videos
    • Testing Newwork Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCStatistics
      • TRTCCloudListener
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • Error Codes
    • Release Notes
  • iOS
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Setting Video Quality
      • 10.Rotating Videos
    • Testing Network Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • ErrorCode
    • Release Notes
  • macOS
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Testing Hardware Devices
    • Testing Network Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • TRTCCloud
      • TRTCCloudDelegate
      • TRTCStatistics
      • TXAudioEffectManager
      • TXBeautyManager
      • TXDeviceManager
      • Type Definition
      • Deprecated Interface
      • ErrorCode
      • Release Notes
    • Release Notes
  • Windows C++
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Setting Video Quality
      • 10.Rotating Videos
    • Testing Hardware Devices
    • Testing Network Quality
    • Custom Capturing and Rendering
    • Custom Audio Capturing and Playback
    • Client APIs
      • Overview
      • ITRTCCloud
      • ITRTCStatistics
      • TRTCCloudCallback
      • ITXAudioEffectManager
      • ITXDeviceManager
      • Type Definition
      • Deprecated Interface
      • Error Codes
    • Release Notes
  • Electron
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Client APIs
      • Overview
      • Error Codes
  • Flutter
    • Integration
      • 1.API Examples
      • 2.Importing the SDK
      • 3.Entering a Room
      • 4.Subscribing to Audio/Video Streams
      • 5.Publish Audio/Video Streams
      • 6.Exiting a Room
      • 7.Sensing Network Quality
      • 8.Enabling Screen Sharing
      • 9.Sharing Computer Audio
      • 10.Setting Video Quality
      • 11.Rotating Videos
    • Client APIs
      • Overview
      • Error Codes
  • Unity
    • Integration
      • 1.API Examples
      • 2Importing the SDK
    • Client APIs
      • Overview
      • Error Codes
  • Qt
    • Integration
      • 1.Importing the SDK
  • Overview
    • Overview
  • Pricing
    • RTC-Engine Packages
    • Billing of On-Cloud Recording
    • Billing of MixTranscoding and Relay to CDN
    • Billing Explanation for Subscription Package Duration
    • Billing of Monitoring Dashboard
    • Free Minutes
    • Pay-As-You-Go
  • Concepts
  • Features
  • Performance Statistics
  • FAQs
    • FAQs for Beginners
    • Migration Guide
      • Twilio Video to Tencent RTC
      • Billing
      • Features
      • UserSig
      • Firewall Restrictions
      • How to Downsize Installation Package
      • TRTCCalling for Web
      • Audio and Video Quality
      • Others
RTC Engine

2.Importing the SDK

This document describes how to quickly integrate the TRTC Windows C++ SDK using an MFC project.




Environment Requirements

OS: Windows 7 or later
Development environment: Visual Studio 2010 or later (v2015 is recommended)


Integrating C++ SDK via MFC project

The following describes how to integrate the TRTC Windows C++ SDK into an MFC project in Visual Studio.

Step 1. Download the SDK

Download the SDK, decompress, and open it. You only need to import the SDK files for Windows C++ in the SDK folder. For example, you can find the SDK files for 64-bit Windows in ./SDK/CPlusPlus/Win64/. The folder contains the following files:
Directory
Description
include
API header files with comments
lib
The LIB file for compilation and DLL files to load


Step 2. Create a project

Open Visual Studio and create an MFC application named TRTCDemo. To better describe how to integrate quickly, we choose the relatively simple Dialog-based type on the Application Type page of the wizard. For other configuration items, keep the default configurations.

Step 3. Copy and paste files

Copy the SDK folder to the directory where TRTCDemo.vcxproj is located.
explain
Because you will only need the C++ SDK, you can delete the CSharp folder in SDK.




Step 4. Modify the project configuration

Select Solution Explorer, right-click TRTCDemo, and select Properties. Configure the project as follows:
1. Add include directories. Go to C/C++ > General. Add the $(ProjectDir)SDK\CPlusPlus\Win64\include and $(ProjectDir)SDK\CPlusPlus\Win64\include\TRTC header file directories (for 64-bit Windows) to Additional Include Directories.
explain
For 32-bit Windows, add $(ProjectDir)SDK\CPlusPlus\Win32\include and $(ProjectDir)SDK\CPlusPlus\Win32\include\TRTC.


2. Add additional library directories Go to Linker > General. Add the $(ProjectDir)SDK\CPlusPlus\Win64\lib directory to Additional Library Directories.
explain
For 32-bit Windows, add $(ProjectDir)SDK\CPlusPlus\Win32\lib.


3. Add the library file Go to Linker > Input, and add the library file liteav.lib to Additional Dependencies.

4. Add the copy command Go to Build Events > Post-build Events and add the copy command copy /Y $(ProjectDir)SDK\CPlusPlus\Win64\lib\*.dll $(OutDir) (for 64-bit Windows) to Command Line. This ensures that the DLL files of the SDK are automatically copied to the project's execution directory after compilation.
explain
For 32-bit Windows, add copy /Y $(ProjectDir)SDK\CPlusPlus\Win32\lib\*.dll $(OutDir).




Step 5. Print the SDK version number

1. At the top of the TRTCDemoDlg.cpp file, add the code below to import the header file:
#include "ITRTCCloud.h"
2. In the CTRTCDemoDlg::OnInitDialog function, add the following test code:
ITRTCCloud * pTRTCCloud = getTRTCShareInstance();
CString szText;
szText.Format(L"SDK version: %hs", pTRTCCloud->getSDKVersion());

CWnd *pStatic = GetDlgItem(IDC_STATIC);
pStatic->SetWindowTextW(szText);
3. Press F5 to run the project and print the version number of the SDK.



FAQs

If the following error occurs, check whether the SDK header file directories are correctly added as described in the project configuration step above.
fatal error C1083: Could not open include file: "TRTCCloud.h": No such file or directory
If the following error occurs, check whether the SDK library directory and library file are correctly added as described in the project configuration step above.
error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class TXString __cdecl TRTCCloud::getSDKVersion(void)" (__imp_?getSDKVersion@TRTCCloud@@SA?AVTXString@@XZ), referenced in function "protected: virtual int __thiscall CTRTCDemoDlg::OnInitDialog(void)" (?OnInitDialog@CTRTCDemoDlg@@MAEHXZ)