ortp库的安装-Ubuntu18.04

版权声明:原创文章,欢迎转载,但请注明出处,谢谢。https://blog.csdn.net/qiuguolu1108/article/details/106445799

ortp库实现了rtp/rtcp协议。

一、环境

本文使用Ubuntu18.04安装ortp库,cmake的版本如下:

root@learner:~# cmake --version
cmake version 3.10.2
二、安装依赖

ortp库依赖bctoolbox库,而bctoolbox库依赖mbedtls库。

安装mbedtls库

mbedtls库在github的地址:https://github.com/ARMmbed/mbedtls

下载mbedtls
git clone https://github.com/ARMmbed/mbedtls
编译安装mbedtls
cd mbedtls
mkdir build
cd build
cmake .. -DUSE_SHARED_MBEDTLS_LIBRARY=ON
make && make install

注意:编译生成的静态库和动态库,库文件安装在了/usr/local/lib,头文件安装在了/usr/local/include

安装bctoolbox库

bctoolbox库在github的地址:https://github.com/BelledonneCommunications/bctoolbox

下载bctoolbox
git clone https://github.com/BelledonneCommunications/bctoolbox.git
编译安装bctoolbox
cd bctoolbox
mkdir _build
cd _build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_TESTS_COMPONENT=NO
make && make install
三、ortp库的编译安装

ortp库在github的地址:https://github.com/BelledonneCommunications/ortp

下载ortp库
git clone https://github.com/BelledonneCommunications/ortp.git
编译安装ortp
cd ortp
mkdir _build
cd _build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make && make install
添加libmbedtls.so库所在的路径

在运行测试示例的时候,会报error while loading shared libraries: libmbedtls.so.12: cannot open shared object file: No such file or directory错误,应该是libmbedtls.so.12库所在的路径/usr/local/lib无法被自动加载。所以需要将上述路径加载到动态库搜索路径中。

vim /etc/ld.so.conf     #打开这个文件

在打开的文件中添加:/usr/local/lib

include /etc/ld.so.conf.d/*.conf

/usr/local/lib

运行ldconfig 更新一下/etc/ld.so.cache。

测试

示例文件在ortp/src/test目录中,进入这个目录。

gcc test_timer.c -lortp -lbctoolbox

编译测试文件,运行结果如下:

root@learner:/opt/ortp/ortp/src/tests# ./a.out 
doing something...
doing something...
doing something...
doing something...
doing something...
doing something...
doing something...
doing something...
doing something...
doing something...

运行成功~~~

参考:https://blog.csdn.net/wang3141128/article/details/80481111

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值