Ubuntu下编译Libjingle


$ gclient config http://libjingle.googlecode.com/svn/trunk    生成.gclient文件
$ gclient sync                获取源代码

$ gclient runhooks         生成Makefile文件


执行runhooks 这步会出现如下几个错误 :


Updating projects from gyp files...
Package nss was not found in the pkg-config search path.
Perhaps you should add the directory containing `nss.pc'
to the PKG_CONFIG_PATH environment variable
No package 'nss' found

安装这个包即可 :apt-get install libnss3-dev

Updating projects from gyp files...
Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found

安装这个包即可 :apt-get install libgtk2.0-dev


下来 cd  trunk 目录, 已经有Makefile 文件了,

直接Make, 出错如下:


  CXX(target) out/Debug/obj.target/libjingle/talk/base/helpers.o
talk/base/helpers.cc:34:26: 致命错误: openssl/rand.h:没有那个文件或目录
编译中断。
make: *** [out/Debug/obj.target/libjingle/talk/base/helpers.o] 错误 1


下载

openssl-1.0.1e.tar.gz 安装

 ./config --prefix=/usr --openssldir=/usr/openssl

make
make test
make install

安装好了 openssl, 在进入到 Libjingle 的trunk目录, 继续make


编译成功了, 但是链接出错 :

out/Debug/../../third_party/gold/gold32: /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libssl.a(t1_enc.o): in function tls1_change_cipher_state:t1_enc.c(.text+0x7d0): error: undefined reference to 'COMP_CTX_free'
out/Debug/../../third_party/gold/gold32: /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libssl.a(t1_enc.o): in function tls1_change_cipher_state:t1_enc.c(.text+0x7ed): error: undefined reference to 'COMP_CTX_new'
out/Debug/../../third_party/gold/gold32: /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libssl.a(t1_enc.o): in function tls1_change_cipher_state:t1_enc.c(.text+0x8aa): error: undefined reference to 'COMP_CTX_free'
out/Debug/../../third_party/gold/gold32: /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libssl.a(t1_enc.o): in function tls1_change_cipher_state:t1_enc.c(.text+0x8c3): error: undefined reference to 'COMP_CTX_new'


出现上面的错误的原因是库的链接顺序不对造成的,如果为 -lcrypto -lssl就会编译错误。需要修改为 -lssl  -lcrypto , 从编译的项目里面找到 mk 文件, 搜索-lssl, 把它放到 -lcrypto的前面即可。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

langeldep

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值