首先安装 subversion client:
sudo apt-get install subversion subversion-tools到官网下载 libjingle repository:
svn checkout http://libjingle.googlecode.com/svn/trunk/ libjingle-0.4.0或者直接到官网下载源码 libjingle-0.4.0.tar.gz:
wget http://libjingle.googlecode.com/files/libjingle-0.4.0.tar.gz tar zxvf libjingle-0.4.0.tar.gz安装依赖库:
sudo apt-get install libexpat1-dev libglib2.0-dev libogg-dev libssl-dev libasound2-dev libspeex-dev openssl下载 ortp, speex, iLBC 源码并安装:
wget http://ftp.twaren.net/Unix/NonGNU/linphone/ortp/sources/ortp-0.16.1.tar.gz tar zxvf ortp-0.16.1.tar.gz cd ortp-0.16.1 ./configure make sudo make install
wget http://downloads.us.xiph.org/releases/speex/speex-1.0.5.tar.gz tar zxvf speex-1.0.5.tar.gz cd speex-1.0.5 ./configure make sudo make install
wget ftp://ftp.eenet.ee/pub/FreeBSD/distfiles/ilbc-rfc3951.tar.gz tar zxvf ilbc-rfc3951.tar.gz cd ilbc-rfc3951 ./configure make sudo make install编译安装 libjingle:
cd libjingle-0.4.0 ./configure --with-ilbc=/usr/local --with-speex=/usr/local make sudo make install编译的过程,会遇到很多的错误。其中之一是因为 gcc4(使用 gcc --version 查看 gcc 版本)造成的,二是 ortp 的版本问题,另外就是 fileshare 的 bug。
cd libjingle-0.4.0 wget "http://libjingle.googlecode.com/issues/attachment?aid=-5750252352650129752&name=libjingle-0.4.0-gcc43.patch" -O gcc43.patch wget "http://libjingle.googlecode.com/issues/attachment?aid=-673077151193645057&name=ortp.patch" -O ortp.patch wget "http://libjingle.googlecode.com/issues/attachment?aid=8593976822449450369&name=libjingle-fileshare.patch" -O fileshare.patch patch -p0 < gcc43.patch patch -p1 < ortp.patch patch -p1 < fileshare.patch除了这些 patch,我们还需要手工修改个别文件,就是在下面源码文件头上添加“#include <stdio.h>”即可:
- talk/base/logging.cc
- talk/base/stream.cc
- talk/p2p/base/stunserver_unittest.cc
- talk/p2p/base/session_unittest.cc
- talk/p2p/base/port_unittest.cc
- talk/session/phone/phonesessionclient.cc
- talk/session/fileshare/fileshare.cc
- talk/examples/login/login_main.cc
- talk/examples/call/call_main.cc
- talk/examples/call/console.h
root001@ubuntu001:~$ /usr/local/bin/pcp JID: greatfoolbear@gmail.com Password: Logging in. Logged in as greatfoolbear@gmail.com/pcpC10A1532 Receiving 1 files (11.4 MiB) from smartfoolbear@gmail.com File transfer started. File transfer failed. session.cc(377): state_ == STATE_RECEIVEDINITIATE @ ChooseTransport Aborted这是问题修改“talk/base/unixfilesystem.cc”文件,在函数“UnixFilesystem::GetTemporaryFolderI()”最后加入“return true”,即可:
bool UnixFilesystem::GetTemporaryFolderI(Pathname &pathname, bool create, const std::string *append) { pathname.SetPathname("/tmp"); if (append) { pathname.AppendFolder(*append); if (create) CreateFolder(pathname); } return true; }FYI:
8 条评论 :
Thanks- ANil
@Anil, you are welcome.
今天在 Ubuntu 下又编译了一遍 LibJingle,发现又要 patch,又要手工改 code,太麻烦了。
我干脆把改好的 code 打个包放出来,将来只要解压、覆盖过去,就能立刻编译成功了。
好了,这个包放在http://code.google.com/p/libjingle/issues/detail?id=16&can=5#c11,有兴趣的朋友可以试试。
你好,我在编译libjingle的时候遇到下面的错误:
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/.libs/libmediastreamer.a(msilbcdec.o): In function `ms_ilbc_decoder_process':
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/msilbcdec.c:175: undefined reference to `iLBC_decode'
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/msilbcdec.c:177: undefined reference to `iLBC_decode'
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/.libs/libmediastreamer.a(msilbcdec.o): In function `ms_ilbc_decoder_setup':
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/msilbcdec.c:121: undefined reference to `initDecode'
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/.libs/libmediastreamer.a(msilbcenc.o): In function `ms_ilbc_encoder_setup':
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/msilbcenc.c:175: undefined reference to `initEncode'
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/.libs/libmediastreamer.a(msilbcenc.o): In function `ms_ilbc_encoder_process':
/home/helen/Project/libjingle/libjingle-0.4.0/talk/third_party/mediastreamer/msilbcenc.c:230: undefined reference to `iLBC_encode'
但是我已经把ilbc的链接添加了,不知道为什么还会出现找不到函数的定义。
@田金凤, 你确认你下载的软件版本和我上面写的一致么?否则不应该出错。或者试试不用 iLBC 是否可以 make 过 。
@大笨熊,你好,谢谢你的回复。我找到问题了,talk/example/call/Makefile里面编译选项中使用的库文件位置有问题,把$(ILBC_LIBS) 放到$(MEDIA_LIBS)后面就可以了。
@田金凤,
ok,那应该是新版本做的变化。
发表评论