2012-09-27 32 views
2

我想編譯SRTP庫,但在配置星號密碼的星號,我得到這個錯誤:錯誤編制星號與libsrtp

checking for the ability of -lsrtp to be linked in a shared object... no 
configure: WARNING: *** 
configure: WARNING: *** libsrtp could not be linked as a shared object. 
configure: WARNING: *** Try compiling libsrtp manually. Configure libsrtp 
configure: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr 
configure: WARNING: *** replacing /usr with the prefix of your choice. 
configure: WARNING: *** After re-installing libsrtp 
configure: WARNING: *** configure script. 
configure: WARNING: *** 
configure: WARNING: *** If you do not need SRTP support re-run configure 
configure: WARNING: *** with the --without-srtp option. 

而且這是檢查這個規則的代碼:

if test "$PBX_SRTP" = "1"; 

then 

    saved_libs="${LIBS}" 
    saved_ldflags="${LDFLAGS}" 
    LIBS="${LIBS} -lsrtp" 
    LDFLAGS="${LDFLAGS} -shared -fPIC" 
    AC_MSG_CHECKING(for the ability of -lsrtp to be linked in a shared object) 
    AC_LINK_IFELSE(
    [ 
     AC_LANG_PROGRAM(
      [#include <srtp/srtp.h>], 
      [srtp_init();] 
     ) 
    ], 

    [ AC_MSG_RESULT(yes) ], 
    [ 
     AC_MSG_RESULT(no) 
     AC_MSG_NOTICE(***) 
     AC_MSG_NOTICE(*** libsrtp could not be linked as a shared object) 
     AC_MSG_NOTICE(*** try compiling libsrtp manually and configuring with) 
     AC_MSG_NOTICE(*** ./configure CFLAGS=-fPIC --prefix=/usr) 
     AC_MSG_NOTICE(*** replacing /usr with the prefix of your choice) 
     exit 1 
    ] 
    ) 
    LIBS="${saved_libs}" 
    LDFLAGS="${saved_ldflags}" 
fi 

提交詳細:https://reviewboard.asterisk.org/r/857/diff/

我嘗試編譯libsrtp代碼的幾個前綴,但我得到了相同的結果。 有什麼建議嗎?

回答

1

一個簡單的調用srtp_init()構建腳本檢查以編譯,以這種有效,你應該有包含<srtp>在路徑上的文件夾包括文件和鏈接器的路徑中創建.a庫。因此在創建libsrtp後,將前綴放在鏈接器路徑中

6

警告說它無法與libsrtp鏈接,因爲libsrtp的代碼需要可重定位,就像共享庫一樣,並且您似乎將libsrtp編譯爲一個靜態庫,我願意做,因爲它暗示和重新使用建libsrtp

./configure CFLAGS=-fPIC 

我也試過,在這裏,它的工作,請注意,我用的默認前綴/在構建libsrtp時使用/ local/lib

./configure --with-srtp=/usr/local/lib 
checking for srtp_init in -lsrtp... yes 
checking srtp/srtp.h usability... yes 
checking srtp/srtp.h presence... yes 
checking for srtp/srtp.h... yes 
checking for the ability of -lsrtp to be linked in a shared object... yes 
5

在SRTP文件夾:

make uninstall 
make clean 
./configure CFLAGS=-fPIC --prefix=/usr/local/lib 
make 
make runtest 
make install 
Asterisk的文件夾

cd ../../asterisk/asterisk-11.3.0/ 
./configure --with-srtp=/usr/local/lib 

這爲我工作

+0

這爲我工作。謝謝。 – Lavixu