博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
嵌入式linux交叉编译jrtplib库
阅读量:4160 次
发布时间:2019-05-26

本文共 1521 字,大约阅读时间需要 5 分钟。

1. 在官网上面下载jrtplib-3.7.1.tar.gz和jthread-1.2.1.tar.gz source code。

官网:http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib
http://research.edm.uhasselt.be/jori/jrtplib/jrtplib-3.7.1.tar.gz
http://research.edm.uhasselt.be/jori/jthread/jthread-1.2.1.tar.gz
2.解压及交叉编译。

2.1 编译,install jthread lib。

    必须编译、安装jthread lib,因为jrtplib会用到jthread的API,所以必须先编译安装jthread lib,否则调用jthread会报
undefine 的错误。
    进入jthread-1.2.1 folder,执行:

# ./configure -host=arm-none-linux-gnueabi -prefix=/usr/local/arm-2010q1

说明:指定所用交叉编译器及路径。

#make

#make install

说明:安装完后在/usr/local/arm-2010q1/lib下会生成jthread的相关lib,及在/usr/local/arm-2010q1/include会生成3个.h文件,分别为:jmutex.h,jmutexautolock.h以及jthread.h。

2.2 编译、安装jrtplib

同样先要对其进行config,如下所示:
./configure -host=arm-none-linux-gnueabi -prefix=/usr/local/arm-2010q1 CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ --with-jthread-include=/usr/local/arm-2010q1/include/jthread LDFLAGS=-L/usr/local/arm-2010q1/lib

说明:指定交叉编译器,及其路径,链接器g++,jthread .h头文件,以及lib所在路径,不指定的话,有可能会找不到,同样也会报jpthread API undefine的错误。

config完后开始make,但是这时会报错,所以要进行如下修改:

2.2.1 在jrtplib目录下的src中,将rtpdefines.h中的三个snprintf改成printf。 

#if (defined(WIN32) || defined(_WIN32_WCE))
#if (!defined(_WIN32_WCE)) && (defined(_MSC_VER) && _MSC_VER >= 1400 )
#define RTP_SNPRINTF printf
#else
#define RTP_SNPRINTF  printf
#endif
#else
#define RTP_SNPRINTF  printf
#endif // WIN32 || _WIN32_WCE#endif // RTPDEFINES_H 

2.2.2 在rtpdefines.h,rtppacket.h,rtcpcompoundpacketbuilder.h中添加头文件stdio.h和string.h。

改完后再进行make

#make

#make install

至此jrtplib就交叉编译完成了。

 

转载地址:http://bmdxi.baihongyu.com/

你可能感兴趣的文章
Single Number II --出现一次的数(重)
查看>>
对话周鸿袆:从程序员创业谈起
查看>>
Mysql中下划线问题
查看>>
Xcode 11 报错,提示libstdc++.6 缺失,解决方案
查看>>
Windows mysql 安装
查看>>
python循环语句与C语言的区别
查看>>
vue项目打包后无法运行报错空白页面
查看>>
Vue 解决部署到服务器后或者build之后Element UI图标不显示问题(404错误)
查看>>
element-ui全局自定义主题
查看>>
facebook库runtime.js
查看>>
js报错显示subString/subStr is not a function
查看>>
高德地图js API实现鼠标悬浮于点标记时弹出信息窗体显示详情,点击点标记放大地图操作
查看>>
初始化VUE项目报错
查看>>
vue项目使用安装sass
查看>>
在osg场景中使用GLSL语言——一个例子
查看>>
laravel 修改api返回默认的异常处理
查看>>
laravel事务
查看>>
【JavaScript 教程】浏览器—History 对象
查看>>
这才是学习Vite2的正确姿势!
查看>>
7 个适用于所有前端开发人员的很棒API,你需要了解一下
查看>>