Build ccRTP in Ubuntu

ccRTP安装与调试指南
本文详细介绍了ccRTP的安装过程,包括依赖库commoncpp的安装与配置,以及解决在不同操作系统(如Ubuntu和CentOS)上遇到的问题。重点解决了在CentOS上因commoncpp未正确配置导致的错误,通过调整环境变量和手动指定编译参数来解决问题。此外,还解决了ccrtp编译过程中因缺少makeinfo和链接库中函数未定义的问题。

参考:http://www.mike.org.cn/articles/description-configure-pkg-config-pkg_config_path-of-the-relations-between/


ccRTP简介:


GitHub主页:https://github.com/dyfet/ccrtp


前提条件:


如果没有安装GNU Toolchain或其他必要软件,请安装。比如:

sudo apt-get install binutils automake* autoconf* libtool texinfo


下载源码:

  1. cd /home/yasi
  2. wget https://github.com/dyfet/ccrtp/archive/master.zip .
  3. unzip master.zip


安装依赖的commoncpp库:

  1. 在 https://ftp.gnu.org/gnu/commoncpp/ 找到最新的包 https://ftp.gnu.org/gnu/commoncpp/ucommon-6.3.1.tar.gz
  2. cd /home/yasi
  3. wget https://ftp.gnu.org/gnu/commoncpp/ucommon-6.3.1.tar.gz .
  4. unzip ucommon-6.3.1.tar.gz
  5. cd ucommon-6.3.1
  6. ./autogen.sh (生成configure文件)
  7. ./configure
  8. sudo make && make check && make install (没有sudo的话,make install 会失败的)


Build ccRTP:


先前已经安装下载解压到了/home/yasi/master 路径下

  1. cd /home/yasi/master
  2. ./autogen.sh (生成configure文件)
  3. ./configure
  4. sudo make && make check && make install (没有sudo的话,make install 会失败的)

CentOS上的安装:


步骤与Ubuntu类似,只是 apt-get install 改成 yum install,但是遇到一些问题。


问题一:

即使commoncpp已经做过了make install,在ccrtp的configure阶段仍然出现下面的提示

checking for COMMONCPP... configure: error: Package requirements (commoncpp >= 6.2.2) were not met:

No package 'commoncpp' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables COMMONCPP_CFLAGS
and COMMONCPP_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

解决方法:

参考《简述configure、pkg-config、pkg_config_path三者的关系

1)查找commoncpp.pc文件安装路径,比如执行 sudo updatedb && locate commoncpp.pc 得到 /usr/local/lib/pkgconfig/commoncpp.pc,则安装路径为 /usr/local/lib/pkgconfig/,执行 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:$PKG_CONFIG_PATH

2)然后再 cd /home/yasi/mast && ./configure


问题二:

对ccrtp做make时,出现下面错误提示。

make[2]: Entering directory `/home/yasi/ccrtp-master/doc'
restore=: && backupdir=".am$$" && \
        am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
        rm -rf $backupdir && mkdir $backupdir && \
        if (/bin/sh /home/yasi/ccrtp-master/autoconf/missing --run makeinfo --version) >/dev/null 2>&1; then \
          for f in ccrtp.info ccrtp.info-[0-9] ccrtp.info-[0-9][0-9] ccrtp.i[0-9] ccrtp.i[0-9][0-9]; do \
            if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
          done; \
        else :; fi && \
        cd "$am__cwd"; \
        if /bin/sh /home/yasi/ccrtp-master/autoconf/missing --run makeinfo --no-warn  -I . \
         -o ccrtp.info ccrtp.texi; \
        then \
          rc=0; \
          CDPATH="${ZSH_VERSION+.}:" && cd .; \
        else \
          rc=$?; \
          CDPATH="${ZSH_VERSION+.}:" && cd . && \
          $restore $backupdir/* `echo "./ccrtp.info" | sed 's|[^/]*$||'`; \
        fi; \
        rm -rf $backupdir; exit $rc
/home/yasi/ccrtp-master/autoconf/missing: line 52: makeinfo: command not found
WARNING: `makeinfo' is missing on your system.  You should only need it if
         you modified a `.texi' or `.texinfo' file, or any other file
         indirectly affecting the aspect of the manual.  The spurious
         call might also be the consequence of using a buggy `make' (AIX,
         DU, IRIX).  You might want to install the `Texinfo' package or
         the `GNU make' package.  Grab either from any GNU archive site.
make[2]: *** [ccrtp.info] Error 1
make[2]: Leaving directory `/home/yasi/ccrtp-master/doc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/yasi/ccrtp-master'
make: *** [all] Error 2

解决方法:

原因在于makeinfo没有安装,这里的makeinfo安装时的名字叫做texinfo

执行 sudo yum install texinfo安装即可


问题三:

ccrtp做make时,遇到下面错误

Making all in demo
make[2]: Entering directory `/home/yasi/ccrtp-master/demo'
g++ -DHAVE_CONFIG_H -I. -I..    -fno-strict-aliasing -Wall -ansi -pedantic -I../src -I../src/ccrtp -g -O2 -Wno-long-long -pthread -fno-check-new -finline -fvisibility=hidden   -c -o rtpsend.o rtpsend.cpp
/bin/sh ../libtool --tag=CXX   --mode=link g++ -fno-strict-aliasing -Wall -ansi -pedantic -I../src -I../src/ccrtp -g -O2 -Wno-long-long -pthread -fno-check-new -finline -fvisibility=hidden     -o rtpsend rtpsend.o ../src/libccrtp.la -lcommoncpp -lucommon -lrt -ldl -lpthread   -lcrypto  -lcrypto
libtool: link: g++ -fno-strict-aliasing -Wall -ansi -pedantic -I../src -I../src/ccrtp -g -O2 -Wno-long-long -pthread -fno-check-new -finline -fvisibility=hidden -o .libs/rtpsend rtpsend.o  ../src/.libs/libccrtp.so -lcommoncpp -lucommon -lrt -ldl -lpthread -lcrypto -pthread -Wl,-rpath -Wl,/usr/local/lib
../src/.libs/libccrtp.so: undefined reference to `Twofish_encrypt'
../src/.libs/libccrtp.so: undefined reference to `Twofish_initialise'
../src/.libs/libccrtp.so: undefined reference to `Twofish_prepare_key'
collect2: ld returned 1 exit status
make[2]: *** [rtpsend] Error 1
make[2]: Leaving directory `/home/yasi/ccrtp-master/demo'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/yasi/ccrtp-master'
make: *** [all] Error 2




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值