back to listing index

Protobuf cannot find shared libraries

[web search]
Original source (stackoverflow.com)
Tags: linux ld
Clipped on: 2016-06-15

I have installed protobuf by using following commands:

./configure
make
make check
make install

However when I run protoc I get following error:

protoc: error while loading shared libraries: libprotoc.so.8: cannot open shared object file: No such file or directory
asked Aug 27 '14 at 3:56
Image (Asset 2/5) alt=
Kshitiz Sharma
4,36663182
up vote 93 down vote accepted
sudo ldconfig

or

export LD_LIBRARY_PATH=/usr/local/lib

should solve the problem.

answered Aug 27 '14 at 3:56
Image (Asset 3/5) alt=
Kshitiz Sharma
4,36663182
1 upvote
  flag
Thanks for sharing, this solve my problem to – Houssam Hsm Dec 29 '14 at 15:48
3 upvote
  flag
@Bagzerg protoc needs to know where to look for shared libraries. (It cannot search your whole system). This is similar to how PATH helps in locating executables. See this post here that explains LD_LIBRARY_PATH. – Kshitiz Sharma Feb 18 '15 at 13:29
   upvote
  flag
as of Feb 2016, installed protocol-buffers 2.6.1 on debian 8, and this solved the problem for missing libraries. Thanks @KshitizSharma – Leonardo Brambilla Feb 18 at 16:57
   upvote
  flag
i used the second method "export..." , but i dont know why the first method doesn't work. – lirui Mar 9 at 7:16
   upvote
  flag
Thanks. It did the job. However, I think, it is more appropriate to use this: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib – ponir Jun 9 at 18:07

This issue can be resolved by following these steps:

sudo make uninstall
sudo make distclean
sudo make clean
./configure --prefix=/usr

This cleans the current installation and installs protobuf at /usr Run ldconfig to update ld.so.cache after making sure that /usr/local/lib is listed in /etc/ld.so.conf. i.e. Edit /etc/ld.so.conf and append /usr/local/lib to it and run ldconfig

answered Jan 27 '15 at 18:58
Image (Asset 4/5) alt=
   upvote
  flag
worked for me without ldconfig (Ubuntu) – Shani Elharrar Jul 19 '15 at 5:46
   upvote
  flag
You've got two separate solutions mixed together here (using ldconfig and simply installing to /usr). Very confusing answer. – David Ljung Madison Oct 6 '15 at 8:09

This issue can be resolved by following these steps:

  1. vim /etc/ld.so.conf
  2. /usr/local/lib(add it in .conf)
answered Mar 27 '15 at 2:51
stevenloo
111
3 upvote
  flag
Missing "ldconfig" which is probably the step that is most required. – David Ljung Madison Oct 6 '15 at 8:09

Your Answer

asked

1 year ago

viewed

14036 times

active

1 year ago

Get the weekly newsletter! In it, you'll get:

  • The week's top questions and answers
  • Important community announcements
  • Questions that need answers

Hot Network Questions

more hot questions
Technology Life / Arts Culture / Recreation Science Other
  1. Stack Overflow
  2. Server Fault
  3. Super User
  4. Web Applications
  5. Ask Ubuntu
  6. Webmasters
  7. Game Development
  8. TeX - LaTeX
  1. Programmers
  2. Unix & Linux
  3. Ask Different (Apple)
  4. WordPress Development
  5. Geographic Information Systems
  6. Electrical Engineering
  7. Android Enthusiasts
  8. Information Security
  1. Database Administrators
  2. Drupal Answers
  3. SharePoint
  4. User Experience
  5. Mathematica
  6. Salesforce
  7. ExpressionEngine® Answers
  8. more (13)
  1. Photography
  2. Science Fiction & Fantasy
  3. Graphic Design
  4. Movies & TV
  5. Seasoned Advice (cooking)
  6. Home Improvement
  7. Personal Finance & Money
  8. Academia
  9. more (9)
  1. English Language & Usage
  2. Skeptics
  3. Mi Yodeya (Judaism)
  4. Travel
  5. Christianity
  6. Arqade (gaming)
  7. Bicycles
  8. Role-playing Games
  9. more (21)
  1. Mathematics
  2. Cross Validated (stats)
  3. Theoretical Computer Science
  4. Physics
  5. MathOverflow
  6. Chemistry
  7. Biology
  8. more (5)
  1. Stack Apps
  2. Meta Stack Exchange
  3. Area 51
  4. Stack Overflow Careers
site design / logo © 2016 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required
rev 2016.6.15.3676