============================================================
============================================================
参考上面的官方文档基本就可以进行编译了
====================================================
说下我的编译环境
操作系统centos7
我是按照推荐编译来编译的Doubango工程
============================================================
编译出错的问题
1.error: dereferencing pointer to incomplete type
src/tls/tnet_dtls.c:119:47:error: dereferencing pointer to incomplete type
if(_tnet_dtls_is_fingerprint_matching(ctx->cert, &socket->remote.fp,socket->remote.hash) == tsk_false) {
openssl版本问题导致的
采用openssl-1.0.1c版本进行手动编译便可解决
2.
INT_MAX
错误
缺少<limits.h>头文件所致 找到报错的代码。把该头文件#include包含进去
3.error: parameter 3 ('encoder') has incompletetype
查看对应的头文件,发现CodecID应该替换成AVCodecID #include <libavcodec/avcodec.h> staticinttdav_codec_h263_init(tdav_codec_h263_t* self, tdav_codec_h263_type_t type,enumAVCodecIDencoder,enumAVCodecIDdecoder) 把对应报错的文件中所有的CodecID都替换成AVCodecID(这是FFMpeg库代码中声明的)
4.NDK环境变量配置
我的环境变量配置
export NDK=/home/webrtc/ndk export PATH=$NDK:$PATH doubango的NDK检测脚本,这里可以看到NDK的命名必须为NDK if [ x$NDK="x"] then echo ERROR: NDK env variable is not set exit1; fi
编译成功后的结果
===================================================
....
Libraries have been installed in: /home/webrtc/doubango/android-projects/output/gpl/x86/lib
...
查看该目录就能看到对应的.so库会生成