原来按照官方指南在CentOS 6.4上安装的Freeswitch,一切顺利。后来需要增加一个xml curl模块,修改了modules.conf之后编译出错:
/usr/lib/libnss3.so: undefined reference to `PR_FindSymbol'
/usr/lib/libnss3.so: undefined reference to `PR_RWLock_Rlock'
/usr/lib/libssl3.so: undefined reference to `PR_OpenAnonFileMap'
/usr/lib/libnss3.so: undefined reference to `PR_UnloadLibrary'
/usr/lib/libnss3.so: undefined reference to `PL_InitArenaPool'
/usr/lib/libnss3.so: undefined reference to `PR_NewRWLock'
/usr/lib/libnss3.so: undefined reference to `PR_RWLock_Wlock'
/usr/lib/libnss3.so: undefined reference to `PR_LoadLibrary'
/lib/libldap_r-2.4.so.2: undefined reference to `PR_GetEnv'
/usr/lib/libnssutil3.so: undefined reference to `PR_LoadLibraryWithFlags'
/usr/lib/libnssutil3.so: undefined reference to `PL_ClearArenaPool'
/usr/lib/libnss3.so: undefined reference to `PR_DestroyRWLock'
/usr/lib/libnss3.so: undefined reference to `PR_NewTCPSocket'
/lib/libldap_r-2.4.so.2: undefined reference to `PR_SetEnv'
/lib/libldap_r-2.4.so.2: undefined reference to `PR_GetLibraryName'
/usr/lib/libssl3.so: undefined reference to `PR_ErrorInstallTable'
/usr/lib/libssl3.so: undefined reference to `PR_ExportFileMapAsString'
/usr/lib/libnssutil3.so: undefined reference to `PR_GetLibraryFilePathname'
/usr/lib/libnss3.so: undefined reference to `PR_FindFunctionSymbol'
/usr/lib/libsmime3.so: undefined reference to `PL_NewHashTable'
/lib/libldap_r-2.4.so.2: undefined reference to `PR_ErrorToString'
/usr/lib/libnss3.so: undefined reference to `PR_RWLock_Unlock'
/usr/lib/libssl3.so: undefined reference to `PR_ImportFileMapFromString'
/lib/libldap_r-2.4.so.2: undefined reference to `PR_GetDirectorySeparator'
collect2: ld returned 1 exit status
make[1]: *** [freeswitch] 错误 1
make: *** [all] 错误 2
搜了一下,找到一个Bug报告,大概意思就是在CentOS6上libcurl用到了libnss3.so,而libnss3.so需要libnspr4.so。第一次make的时候用了系统提供的/lib/libnspr4.so,这个没问题。然后再编译的时候就去用了/usr/local/freeswitch/lib/libnspr4.so,这个就有问题了。解决方法有两个,一是 ./configure –without-libcurl,而是删掉/usr/local/freeswitch/lib。
不过第一个方法对我来说不管用,因为xml curl本来就需要用到libcurl,不能去掉。