ZLMediaKit交叉编译

一、下载ZLMediaKit源码

#国内用户推荐从同步镜像网站gitee下载

git clone --depth 1 https://gitee.com/xia-chu/ZLMediaKit
cd ZLMediaKit
git submodule update --init

本文福利, 免费领取C++音视频学习资料包、技术视频,内容包括(音视频开发,面试题,FFmpeg webRTC rtmp hls rtsp ffplay srs↓↓↓↓↓↓见下面↓↓文章底部点击免费领取↓↓

二、配置CMakelist.txt

set(CMAKE_CXX_STANDARD 11)
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm)
SET(TOOLCHAIN_DIR "/opt/linux/x86-arm/aarch64-mix210-linux")
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/aarch64-mix210-linux-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/aarch64-mix210-linux-g++)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -o3 -std=c++0x -fpermissive")

三、编译 

mkdir build
cd build
cmake ..
make -j4

有些交叉工具链可能会在编译时出问题:

问题:

1、openssl头文件找不到

ZLMediaKit交叉编译_第1张图片

2、ffmpeg、openssl库文件找不到

 

解决:配置CMakelist.txt

include_directories(/work_share/openssl_aarch64/include)
link_directories(/work_share/FFmpeg_aarch64/lib /work_share/openssl_aarch64/lib )
link_libraries(avcodec avutil swresample swscale ssl crypto)

本文福利, 免费领取C++音视频学习资料包、技术视频,内容包括(音视频开发,面试题,FFmpeg webRTC rtmp hls rtsp ffplay srs↓↓↓↓↓↓见下面↓↓文章底部点击免费领取↓↓ 

你可能感兴趣的:(音视频开发进阶,github,视频编解码,音视频,实时音视频,webrtc)