发布编译旧版0.9.0 c++客户端

Issue compiling thrift 0.9.0 c++ client

本文关键字:c++ 客户端 布编译 编译      更新时间:2023-10-16

我曾尝试在ubuntu precise32:上使用fract 0.9.0编译一个cpp应用程序

g++ hello_client.cpp gen-cpp/HelloSvc.cpp -lthrift

然而,这会导致:

In file included from /usr/local/include/thrift/transport/TSocket.h:25:0,
                 from hello_client.cpp:4:
/usr/local/include/thrift/transport/TTransport.h:34:1: error: 'uint32_t' does not name a type
/usr/local/include/thrift/transport/TTransport.h:107:3: error: 'uint32_t' does not name a type
...

我试图通过修复0.9.0

1) 安装python-dev(我注意到一个错误:构建节俭时缺少python.h)

sudo apt-get install python-dev

2) 建筑节俭与:

./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H"

仍然有同样的错误,所以我决定签出、构建并安装最新的旧版本(git中的HEAD版本6f2a5037105ccad05eb84ec0a60da3389c85eb3f)。

使用最新的节俭,构建cpp客户端时没有出现任何错误。但是,运行a.out返回错误:

./a.out: error while loading shared libraries: libthrift-1.0.0-dev.so: cannot open 
         shared object file: No such file or directory

将LD_LIBRARY_PATH设置为新建的旧库修复了以下问题:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$THRIFT_SRC/lib/cpp/.libs/