thrift实现一个C++实例遇到的问题

问题1:Building C++ Library ......... : no
源码安装boost库,在thrift安装中configure命令时,会出现上述错误,最后根据下面链接用apt命令安装boost库就没有这个问题了

安装:http://www.tuicool.com/articles/m2EjQn

不是说源码安装boost库不行,可能是哪里没有设置好。


问题2:编译代码出现很多形如undefined reference to `apache::thrift::的错误

实例:http://blog.csdn.net/hbuxiaoshe/article/details/6558391

最后发现:-lthrift一定要放在后面

参考:http://my.oschina.net/zmlblog/blog/177245 

例:

服务端编译:

g++ -g -I/usr/local/include/thrift -L/usr/local/lib/ Serv.cpp student_types.cpp student_constants.cpp Serv_server.skeleton.cpp -o server -lthrift

客户端编译:

g++ -g -I/usr/local/include/thrift -L/usr/local/lib/ -lm -pthread -lz -lrt -lssl Serv.cpp student_types.cpp student_constants.cpp client.cpp -o client -lthrift


最后,有一个很好的thrift C++实例:

http://blog.csdn.net/linyanwen99/article/details/8281508



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值