Installing protocol buffers on Linux

1,464 views
Skip to first unread message

Russell

unread,
Jul 23, 2008, 11:50:26 AM7/23/08
to Protocol Buffers
After completing the installation of protocol buffers on Linux I
noticed a problem which a symbolic link to "libprotobuf.so" was not
created with a absolute path.

[~/dev/protobuf-2.0.0beta/examples] {4} protoc
protoc: error while loading shared libraries: libprotobuf.so.0: cannot
open shared object file: No such file or directory

I had the path in installed my libraries into in my LD_LIBRARY_PATH
and my ld.so.cache file was updated. Looking at /usr/local/lib/
libprotobuf.so it was linked to libprotobuf.so.0.0.0 in its own
relative path. I ended up creating a new link to this with absolute
paths and now it works fine:

ln -sf /usr/local/lib/libprotobuf.so.0.0.0 /usr/local/lib/
libprotobuf.so

Should I submit a change to the Makefile to use the absolute path for
all symbolic links?

Kenton Varda

unread,
Jul 23, 2008, 4:29:39 PM7/23/08
to Russell, Protocol Buffers
This should all be handled automatically by automake.  Did you use "make install" to install?

Russell McConnachie

unread,
Jul 23, 2008, 4:58:36 PM7/23/08
to Kenton Varda, Protocol Buffers
Yes I used GNU make to install the libraries with "make install".

Kenton Varda

unread,
Jul 23, 2008, 5:23:15 PM7/23/08
to Russell McConnachie, Protocol Buffers
I'm not sure I understand the problem.  On my machine:

$ ls -l /usr/lib/libprotobuf.so
lrwxrwxrwx 1 root root 20 Jul  3 18:03 /usr/lib/libprotobuf.so -> libprotobuf.so.0.0.0

So, it's a relative link.  Yet, everything works fine for me.

It won't work to just submit a patch against the Makefile, because the Makefile is autogenerated from Makefile.am, and I don't think these details appear in Makefile.am.

Maybe it would work better if you installed to /usr instead of /usr/local?  Try passing --prefix=/usr to configure.  (Be sure to "make clean".)
Reply all
Reply to author
Forward
0 new messages