Integrate the SDK
Set up the development environment
Before integrating the ZEGO Express SDK, make sure the development environment meets the following requirements:
- Any Linux distro with GLIBC 2.16 or above, supporting x86_64, aarch64, armhf, armel architectures
- libasound (ALSA)
- libv4l2 (v4l utils)
- CMake 3.7 or later
- The SDK depends on libasound (ALSA) and libv4l2 (v4l utils).
- CentOS (RHEL/Fedora) can be installed by executing
yum install alsa-lib-devel libv4l-devel
command. - Ubuntu (Debian/Deepin) can be installed by executing
apt install libasound2-dev libv4l-dev
command. - For other platforms and systems, please install them by yourself.
- If you need to cross-compile, you can refer to How to cross-compile alsa-lib and How to cross-compile v4l-utils. Note that the target machine also needs to have libasound and libv4l2 dependencies installed.
When using Qt + qmake to integrate the SDK, the version of the Qt you use must be 5.9 - 5.15. For more details, refer to Getting Started with Qt.
Integrate the SDK
Download the latest version of the SDK. For more details, see SDK downloads.
Extract files from the downloaded SDK package, and copy the files under the
release/Library
directory to your project.
When using CMake to integrate the SDK, import the SDK as follows:
Import the SDK in the
CMakeLists.txt
file of your project.cmake_minimum_required(VERSION 3.7) project(MyAwesomeProject) # Add header search path include_directories("./libs/zego/include") # Add lib search path link_directories("./libs/zego") # Link SDK link_libraries(ZegoExpressEngine rt) add_compile_options( -std=c++11 ) aux_source_directory(./src SRC_LIST) add_executable(MyAwesomeProject ${SRC_LIST})
When using Qt + qmake to integrate the SDK, import the SDK as follows:
Add the following to the
<project_name>.pro
file of your project to import the SDK library and header file.unix { contains(QT_ARCH, arm64) { INCLUDEPATH += $$PWD/../libs/ZegoExpress/linux/aarch64/include DEPENDPATH += $$PWD/../libs/ZegoExpress/linux/aarch64/include LIBS += -L$$PWD/../libs/ZegoExpress/linux/aarch64 -lZegoExpressEngine } else:contains(QT_ARCH, arm) { INCLUDEPATH += $$PWD/../libs/ZegoExpress/linux/armhf/include DEPENDPATH += $$PWD/../libs/ZegoExpress/linux/armhf/include LIBS += -L$$PWD/../libs/ZegoExpress/linux/armhf -lZegoExpressEngine } else { # Assume other archs are x86_64 INCLUDEPATH += $$PWD/../libs/ZegoExpress/linux/x86_64/include DEPENDPATH += $$PWD/../libs/ZegoExpress/linux/x86_64/include LIBS += -L$$PWD/../libs/ZegoExpress/linux/x86_64 -lZegoExpressEngine } }