码迷,mamicode.com
首页 > 系统相关 > 详细

linux下的libosip2 libeXosip2编译,应用

时间:2018-12-26 15:43:41      阅读:701      评论:0      收藏:0      [点我收藏+]

标签:dos   ror   address   rom   director   turn   nta   bin   14.   

编译脚本build.sh

参考https://www.linuxidc.com/Linux/2008-10/16291.htm

#下面是一则在Linux平台下编译eXosip2的笔记,可能对大家有用。

#程序包准备

#libosip2-3.0.1.tar.gz
#libeXosip2-3.0.1.tar.gz

#将两个程序包放在同一个目录下

#先编译osip2

tar zxvf libosip2-3.0.1.tar.gz
cd libosip2-3.0.1
./configure
make
make install
cd ..

#解压eXosip2

tar xzxvf libeXosip2-3.0.1.tar.gz

#拷贝头文件和库文件

#然后将osip头文件和编译生成的库文件(libosip2.a和libosipparser2.a)拷贝到相应的目录

cp -rf  libosip2-3.0.1/include/osip2 libeXosip2-3.0.1/include/osip2
cp -rf  libosip2-3.0.1/include/osipparser2 libeXosip2-3.0.1/include/osipparser2
cp libosip2-3.0.1/src/osip2/.libs/libosip2.a /usr/lib
cp libosip2-3.0.1/src/osipparser2/.libs/libosipparser2.a /usr/lib

#再编译eXosip2

cd libeXosip2-3.0.1
./configure
make
make install
cd ..
#后面的应用程序就可以使用头文件和编译生成的库文件了。

1) 在centos7.2 x64下编译成功

Making install in tools
make[1]: Entering directory `/root/1/libeXosip2-3.0.1/tools‘
make[2]: Entering directory `/root/1/libeXosip2-3.0.1/tools‘
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
  /bin/sh ../libtool --mode=install /usr/bin/install -c ‘sip_reg‘ ‘/usr/local/bin/sip_reg‘
/usr/bin/install -c .libs/sip_reg /usr/local/bin/sip_reg
make[2]: Nothing to be done for `install-data-am‘.
make[2]: Leaving directory `/root/1/libeXosip2-3.0.1/tools‘
make[1]: Leaving directory `/root/1/libeXosip2-3.0.1/tools‘
Making install in help
make[1]: Entering directory `/root/1/libeXosip2-3.0.1/help‘
Making install in doxygen
make[2]: Entering directory `/root/1/libeXosip2-3.0.1/help/doxygen‘
make[3]: Entering directory `/root/1/libeXosip2-3.0.1/help/doxygen‘
make[3]: Nothing to be done for `install-exec-am‘.
make[3]: Nothing to be done for `install-data-am‘.
make[3]: Leaving directory `/root/1/libeXosip2-3.0.1/help/doxygen‘
make[2]: Leaving directory `/root/1/libeXosip2-3.0.1/help/doxygen‘
make[2]: Entering directory `/root/1/libeXosip2-3.0.1/help‘
make[3]: Entering directory `/root/1/libeXosip2-3.0.1/help‘
make[3]: Nothing to be done for `install-exec-am‘.
make[3]: Nothing to be done for `install-data-am‘.
make[3]: Leaving directory `/root/1/libeXosip2-3.0.1/help‘
make[2]: Leaving directory `/root/1/libeXosip2-3.0.1/help‘
make[1]: Leaving directory `/root/1/libeXosip2-3.0.1/help‘
make[1]: Entering directory `/root/1/libeXosip2-3.0.1‘
make[2]: Entering directory `/root/1/libeXosip2-3.0.1‘
make[2]: Nothing to be done for `install-exec-am‘.
make[2]: Nothing to be done for `install-data-am‘.
make[2]: Leaving directory `/root/1/libeXosip2-3.0.1‘
make[1]: Leaving directory `/root/1/libeXosip2-3.0.1‘
[root@dong 1]# sip_reg
Usage: sipreg [required_options] [optional_options]

        [required_options]
        -r --proxy      sip:proxyhost[:port]
        -u --from       sip:user@host[:port]

        [optional_options]
        -c --contact    sip:user@host[:port]
        -d --debug (log to stderr and do not fork)
        -e --expiry     number (default 3600)
        -f --firewallip N.N.N.N
        -h --help
        -l --localip    N.N.N.N (force local IP address)
        -p --port       number (default 5060)
        -U --username   authentication username
        -P --password   authentication password
[root@dong 1]#

 

2) 真是见了鬼,在ubuntu下死活编译不过去

###ubuntu14.04报如下错误

Making all in tools
make[2]: Entering directory `/home/dong/1/libeXosip2-3.0.1/tools‘
/bin/bash ../libtool --tag=CC --mode=link gcc -g  -pthread  -DOSIP_MT -pedantic -DENABLE_DEBUG -g -DENABLE_TRACE -g    -o sip_reg -O  -lnsl -lrt -lresolv  sip_reg.o -L/usr/local/lib ../src/libeXosip2.la -losip2 -losipparser2
gcc -g -pthread -DOSIP_MT -pedantic -DENABLE_DEBUG -g -DENABLE_TRACE -g -o .libs/sip_reg -O sip_reg.o  -lnsl -lrt -lresolv -L/usr/local/lib ../src/.libs/libeXosip2.so /usr/local/lib/libosip2.so /usr/local/lib/libosipparser2.so
../src/.libs/libeXosip2.so: undefined reference to `MD5Update‘
../src/.libs/libeXosip2.so: undefined reference to `MD5Final‘
../src/.libs/libeXosip2.so: undefined reference to `MD5Init‘
collect2: error: ld returned 1 exit status
make[2]: *** [sip_reg] Error 1
make[2]: Leaving directory `/home/dong/1/libeXosip2-3.0.1/tools‘
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/dong/1/libeXosip2-3.0.1‘
make: *** [all] Error 2

MD5Update MD5Final  MD5Init这三函数怎么折腾都有问题

linux下的libosip2 libeXosip2编译,应用

标签:dos   ror   address   rom   director   turn   nta   bin   14.   

原文地址:https://www.cnblogs.com/dong1/p/10179042.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!