本文共 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_H2.2.2 在rtpdefines.h,rtppacket.h,rtcpcompoundpacketbuilder.h中添加头文件stdio.h和string.h。
改完后再进行make
#make
#make install至此jrtplib就交叉编译完成了。
转载地址:http://bmdxi.baihongyu.com/