Hi, Yes, add /usr/local/lib to lib path. Now it works. Thanks! Beatls
-----邮件原件----- 发件人: [email protected] [mailto:[email protected]] 发送时间: 2012年10月29日 15:22 收件人: [email protected]; huaxiang 主题: Re: thrift-0.9.0 test failed ? Quoting huaxiang <[email protected]>: > Hi, > After install thrift-0.9.0, and test it with tutorial cpp, failed > with error ' error while loading shared libraries: libthrift-0.9.0.so: > cannot open shared object file: No such file or directory', > > What is problem? /usr/local/lib is not within your library path. do this before executing the CppServer and CppClient export LD_LIBRARY_PATH=/usr/local/lib > > ****************below show the related > information************************ > > [root@hadoop2 cpp]# pwd > /hadoop0/thrift-0.9.0/tutorial/cpp > [root@hadoop2 cpp]# ll > -rwxr-xr-x 1 root root 273514 10? 29 09:57 CppClient > -rw-r--r-- 1 root root 2413 10? 12 08:58 CppClient.cpp > -rwxr-xr-x 1 root root 324935 10? 29 09:57 CppServer > -rw-r--r-- 1 root root 4280 10? 12 08:58 CppServer.cpp > -rw-r--r-- 1 root root 1431 10? 26 16:26 Makefile > [root@hadoop2 cpp]# make > g++ -DHAVE_PTHREAD_H -o CppServer -I/hadoop0/thrift-0.9.0 > -I/usr/include/boost -I../gen-cpp -L/usr/local/lib -lthrift > CppServer.cpp ../gen-cpp/SharedService.cpp ../gen-cpp/shared_types.cpp > ../gen-cpp/tutorial_types.cpp ../gen-cpp/Calculator.cpp > -DHAVE_NETINET_IN_H > g++ -DHAVE_PTHREAD_H -o CppClient -I/hadoop0/thrift-0.9.0 > -I/usr/include/boost -I../gen-cpp -L/usr/local/lib -lthrift > CppClient.cpp ../gen-cpp/SharedService.cpp ../gen-cpp/shared_types.cpp > ../gen-cpp/tutorial_types.cpp ../gen-cpp/Calculator.cpp > -DHAVE_NETINET_IN_H > [root@hadoop2 cpp]# ./CppServer > ./CppServer: error while loading shared libraries: libthrift-0.9.0.so: > cannot open shared object file: No such file or directory > [root@hadoop2 cpp]# ./CppClient > ./CppClient: error while loading shared libraries: libthrift-0.9.0.so: > cannot open shared object file: No such file or directory > > > > BestRegards, >> beatls > > > > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
