又一次安装thrift

with cpp, java, python


make install搞了N次,Ant总提示JAVA_HOME不对
最后看这篇博文[url]http://jayant7k.blogspot.com/2010/04/intro-to-thrift.html[/url]原来需要管理员权限,su一下,再export JAVA_HOME...

另外make自带的tutorial cpp的时候总提示undefined reference...
原来是G++版本的问题...最后我是用4.4.6版本搞定的
see http://mail-archives.apache.org/mod_mbox/thrift-user/201107.mbox/%3C4E3180C3.10204@ens-lyon.fr%3E

[quote]I also tried to compile with various g++ version:

g++ 4.4.6: OK

g++ 4.5.3: OK

g++ 4.6.1: complains about undefined reference to
`apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::VERSION_1'

and undefined reference to
`apache::thrift::protocol::TBinaryProtocolT<apache::thrift::transport::TTransport>::VERSION_MASK'[/quote]

然后还得添加两个宏进去,thrift0.8.0真是开发中版本。。。。。
-DHAVE_NETINET_IN_H -DHAVE_INTTYPES_H
这两个宏都是定义在/usr/local/include/thrift/Thrift.h中的
[code]
g++ -DHAVE_NETINET_IN_H -DHAVE_INTTYPES_H -o CppClient -I/usr/local/include/thrift -I/usr/include/boost -I../gen-cpp -L/usr/local/lib -L/usr/lib -lthrift CppClient.cpp ../gen-cpp/SharedService.cpp ../gen-cpp/shared_types.cpp ../gen-cpp/tutorial_types.cpp ../gen-cpp/Calculator.cpp
[/code]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值