2013-07-09 38 views
1

我曾嘗試在編譯CPP的應用與節儉0.9.0 Ubuntu的precise32:發行編譯節儉0.9.0 C++客戶

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

回答

1

我試着修復0.9.0通過:

1)安裝python-DEV(我注意到一個錯誤:當建築物遺漏python.h節儉)

sudo apt-get install python-dev 

2)建立與節儉:

./configure CPPFLAGS="-DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H" 

仍是同樣的錯誤,所以我決定籤,建立和混帳安裝最新的節儉(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/