ubuntu下jthread 和jrtplib的安装
来源:互联网 发布:淘宝一个月能刷多少单 编辑:程序博客网 时间:2024/05/22 17:41
ubuntu12.04
1.
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.
3.
4.
5.
6.
g++ -o example1 example1.cpp -I /usr/local/include/jrtplib/ -ljrtp
即生成应用程序exmaple1,注意,-I(大写的i)参数中路径为jrtplib头文件目录,根据实际情况修改。如果出现错误,说明动态链接库路径不对,有以下两种方法可以对动态链接库的路径进行设置:
a、修改动态链接库宏LD_LIBRARY_PATH。LD_LIBRARY_PATH 这个环境变量是大家最为熟悉的,它告诉loader:在哪些目录中可以找到共享库。可以设置多个搜索目录,这些目录之间用冒号分隔开。export LD_LIBRARY_PATH=/usr/local/lib,然后再运行编译,即可通过。这种方法只是暂时修改路径,在重启shell后会失效。或者是配置在环境变量文件/etc/profile中,重启或者source /etc/profile 生效,source 只在本控制台生效。
b、永久生效的方法为修改动态链接库配置文件/etc/ld.so.conf,或者在/etc/ld.so.conf.d里创建一个新文件,并把需要的目录加到这个文件里。具体方法如下:(说明:这种修改动态链接库配置的方式需要使用超级用户权限,不然没有对共享库配置文件的写权限)
#cd /etc/ld.so.conf.d
#vim jrtplib在编辑环境下加入/usr/local/lib,保存退出。
#ldconfig
然后再执行编译链接,成功生成example1文件。
然后运行./example1。成功。
关于
说明
jrtp-3.7.1.tar.gz
http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib
一,编译为
PS:./configure –help
jthread-1.2.1
[root@localhost pc-jrtp]# tar -zxvf jthread-1.2.1.tar.gz
[root@localhost pc-jrtp]# cd jthread-
[root@localhost jthread-1.2.1]# ./configure
[root@localhost jthread-1.2.1]# make
[root@localhost jthread-1.2.1]# make install
说明
安装成功后在自己指定目录下有
include
lib
(2) jrtplib-3.7.1
[root@localhost pc-jrtp]# tar -zxvf jrtplib-3.7.1.tar.gz
[root@localhost pc-jrtp]# cd jrtplib-
[root@localhost pc-jrtp]#
说明:
--prefix= --prefix
--with-jthread-includes
LDFLAGS
configure
checking for JThread include files... in "/opt/mini2440/pc-jrtp/include/jthread"
checking JThread version... >=
checking if we can link against jthread and pthread... yes
说明
接着进行
[root@localhost jrtplib-3.7.1]# make
[root@localhost jrtplib-3.7.1]# make install
在不修改源文件情况下
在
rtppacket.cpp:311: error: 'memcpy' was not declared in this scope
或者:
在
rtperrors.cpp: In function 'std::string RTPGetErrorString(int)':
rtperrors.cpp:225: error: 'snprintf' was not declared in this scope
为了
添加如下语句
#include
#include
#include
操作如下:
[root@localhost jrtplib-3.7.1]# cd src/
[root@localhost src]# vim rtpdefines.h
// rtpdefines.h
75 #include
重新
安装成功后在自己指定目录下有
include
lib
二,编译为
步骤与编译为
(1)
./configure
(2)
./configure –prefix=/opt/mini2440/arm-jrtp –host=arm-linux –with-jthread-includes=/opt/mini2440/arm-jrtp/includes CC=arm-linux-gcc CXX=arm-linux LDFLAGS=-L/opt/mini2440/arm-jrtp/lib
然后会看到如下提示信息:
ASSUMING TARGET IS BIG ENDIAN:
说明
我们那么应该测试开发板是大端模式还是小端模式:
至于什么是大端模式,什么小端模式,以及为什么要测试请看我博客上的大端模式与小端模式。
测试程序:
1 #include
保存后用交叉编译器编译生成可执行文件后,放到目标平台上执行。从而判断出目标平台是什么模式。
通过测试下,得知
文件在
/opt/mini2440/arm-jrtp/jrtplib-3.7.1/src
修改操作如下:
33 #ifndef RTPCONFIG_UNIX_H
则是把第
然后就可以
三,最后一步就是测试了:
(1)
(2)
(3)
[root@localhost examples]# ./example4
Enter local portbase:
9090
Number of seconds you wish to wait:
500
(4)
[root@FriendlyARM download]# ./example1
Enter local portbase:
9090
Enter the destination IP address
192.168.0.2
Enter the destination port
9090
Number of packets you wish to be sent:
50
(5)
Got packet 32390 from SSRC 609572025
Got packet 32391 from SSRC 609572025
…….
- ubuntu下jthread 和jrtplib的安装
- ubuntu下jthread 和jrtplib的安装
- ubuntu下jthread 和jrtplib的安装
- ubuntu下jthread 和jrtplib的安装
- Ubuntu 11下安装jrtplib-3.9.1和 jthread - 1.3.1
- ubuntu下编译 jrtplib-3.9.1 和 jthread - 1.3.1
- ubuntu下编译 jrtplib-3.9.1 和 jthread - 1.3.1
- ubuntu下编译 jrtplib-3.9.1 和 jthread - 1.3.1
- ubuntu下编译 jrtplib-3.9.1 和 jthread - 1.3.1
- linux环境下编译 jrtplib 和 jthread
- Linux下编译jrtplib和jthread:
- Linux下编译jrtplib和jthread:
- linux环境下编译 jrtplib 和 jthread
- Linux下编译jrtplib和jthread
- Windows下编译jthread和jrtplib
- windows下编译jrtplib和jthread
- jrtplib和jthread的交叉编译
- 编译jrtplib和jthread
- 现在公开一个DHT网络爬虫
- 补回第四章作业
- 【线段树】 POJ 3667 Hotel
- 进程地址空间与虚拟存储空间的理解
- 闲暇时间看了下DHT网络
- ubuntu下jthread 和jrtplib的安装
- Learning from imbalanced data
- MapReduce C++ Library for single-machine, multicore applications
- 虚拟地址和虚拟内存区别
- 计算机图形学顶级杂志、会议、期刊
- jsp .cookies
- 一个华为人辞职创业后的几个反思
- iOS 按钮set Enable or Disable
- DHT网络原理制作bt采集蜘蛛,开源版