linux下的libosip2 libeXosip2編譯,應用
編譯腳本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‘
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編譯,應用