Protocol buffers Protobuf找不到共享库

Protocol buffers Protobuf找不到共享库,protocol-buffers,Protocol Buffers,我使用以下命令安装了protobuf: ./configure make make check make install 但是,当我运行protoc时,我得到以下错误: protoc: error while loading shared libraries: libprotoc.so.8: cannot open shared object file: No such file or directory 或 应解决此问题。此问题可通过以下步骤解决: sudo make uninstall

我使用以下命令安装了protobuf:

./configure
make
make check
make install
但是,当我运行
protoc
时,我得到以下错误:

protoc: error while loading shared libraries: libprotoc.so.8: cannot open shared object file: No such file or directory


应解决此问题。

此问题可通过以下步骤解决:

sudo make uninstall
sudo make distclean
sudo make clean
./configure --prefix=/usr
这将清理当前安装并在/usr处安装protobuf 确保/etc/ld.so.conf中列出了/usr/local/lib之后,运行ldconfig更新ld.so.cache。即
编辑/etc/ld.so.conf并向其追加/usr/local/lib,然后运行ldconfig

此问题可以通过以下步骤解决:

sudo make uninstall
sudo make distclean
sudo make clean
./configure --prefix=/usr
  • vim/etc/ld.so.conf
  • /usr/local/lib(将其添加到.conf中)
  • 你也可以使用

    $ sudo ldconfig # refresh shared library cache.
    

    @Bagzerg
    protoc
    需要知道在哪里可以找到共享库。(它无法搜索整个系统)。这类似于
    PATH
    如何帮助定位可执行文件。请参阅这篇文章,其中解释了
    LD_LIBRARY_PATH
    。截至2016年2月,在debian 8上安装了protocol buffers 2.6.1,这解决了缺少库的问题。谢谢@kshitizzarmai使用了第二种方法“导出…”,但我不知道为什么第一种方法不起作用。谢谢。它成功了。但是,我认为,使用以下方法更合适:
    export LD_LIBRARY\u PATH=$LD_LIBRARY\u PATH:/usr/local/lib
    Lol对于我来说,重启机器修复了问题您这里混合了两种不同的解决方案(使用ldconfig并简单地安装到/usr)。答案非常混乱。缺少“ldconfig”,这可能是最需要的步骤。
    $ sudo ldconfig # refresh shared library cache.