1

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
...
Chris Snow
  • 23,813
  • 35
  • 144
  • 309

1 Answers1

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/

Chris Snow
  • 23,813
  • 35
  • 144
  • 309