1

I created a simple apache thrift file, and generated cpp code. When I ran the compiled and ran the cpp code, it gives the following error.

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

I had compiled thrift from source, and had not seen any issues while compiling thrift.

Can someone please elaborate is the issue here and how exactly do I get around it ?

Thanks in advance!

JensG
  • 13,148
  • 4
  • 45
  • 55
newcoder
  • 11
  • 2
  • duplicate http://stackoverflow.com/questions/17551531/issue-compiling-thrift-0-9-0-c-client - I'd really love when people would start to use a search engine before asking already answered questions. It took me 20 seconds to find that. – JensG Mar 16 '14 at 00:08
  • Setup evn_var as per instruction given here, [Set path to LD_LIBRARY_PATH](http://stackoverflow.com/a/43470846/2050511) – Hemant Thorat Apr 18 '17 at 11:27

2 Answers2

4
sudo ln -s /usr/local/lib/libthrift-1.0.0-dev.so /usr/lib/libthrift-1.0.0-dev.so
sudo ln -s /usr/local/lib/libthrift-1.0.0-dev.so /usr/lib64/libthrift-1.0.0-dev.so

Or

export LD_LIBRARY_PATH=/usr/local/lib/:${LD_LIBRARY_PATH}

wpercy
  • 9,636
  • 4
  • 33
  • 45
Michael Popovich
  • 301
  • 1
  • 10
0

Setting LD_LIBRARY_PATH to the newly built thrift library should fix it. (taken from Issue compiling thrift 0.9.0 c++ client)

Community
  • 1
  • 1
JensG
  • 13,148
  • 4
  • 45
  • 55