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]
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]
本文详细记录了解决使用cpp、java、python进行Thrift安装时遇到的JAVA_HOME配置错误,以及在tutorialcpp过程中出现的undefined reference问题。通过管理员权限设置JAVA_HOME、升级G++版本以及手动添加Thrift相关宏,最终成功解决问题。同时,提供了编译Thrift客户端所需的命令参数。

876

被折叠的 条评论
为什么被折叠?



