Issue compiling thrift 0.9.0 c++ client

*爱你&永不变心* 提交于 2019-12-24 18:04:00

问题


I have tried compiling a cpp application with thrift 0.9.0 on ubuntu precise32:

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

However, this results in:

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
...

回答1:


I tried to fix 0.9.0 by:

1) Install python-dev (I noticed an error: missing python.h when building thrift)

sudo apt-get install python-dev

2) Building thrift with:

./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H"

Still the same errors, so I decided to checkout, build and install the latest thrift (HEAD version 6f2a5037105ccad05eb84ec0a60da3389c85eb3f in git).

With the latest thrift, there were no errors building the cpp client. However, running a.out returned an error:

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

Setting LD_LIBRARY_PATH to the newly built thrift library fixed this:

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



来源:https://stackoverflow.com/questions/17551531/issue-compiling-thrift-0-9-0-c-client

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!