【问题标题】:how to install lprotobuf-c in ubuntu for c language如何在ubuntu for c语言中安装lprotobuf-c
【发布时间】:2013-04-11 06:59:51
【问题描述】:
/usr/bin/ld: cannot find -lprotobuf-c
collect2: ld returned 1 exit status
make: *** [test_apl] Error 1

这些是我遇到的错误。

我已经安装了apt-get install protobuf-c-compiler,但是makefile仍然没有运行。

【问题讨论】:

  • 你想安装libprotobuf-c0,来获取这个库。 apt-cache search protobuf 在这种情况下会有所帮助,暗示 Protocol Buffers C library

标签: c linux ubuntu compiler-construction makefile


【解决方案1】:

Right installation process for protobuf-c-compiler 需要
在Ubuntu(12.04 LTS)下编译时,需要以下依赖:

sudo apt-get install build-essential libxml2-dev libgeos++-dev libpq-dev libbz2-dev proj libtool automake

如果您想要PBF 阅读支持,您还需要libprotobuf-c0-devprotobuf-c-compiler

sudo apt-get install libprotobuf-c0-dev protobuf-c-compiler

libprotobuf-c0-dev 至少需要在version 0.14-1. Ubuntu <= 10.04 中只有0.11,因此您需要从源代码构建它。从源代码编译:

sudo apt-get install protobuf-compiler libprotobuf-dev libprotoc-dev
svn checkout http://protobuf-c.googlecode.com/svn/trunk/ protobuf-c-read-only
cd protobuf-c-read-only
./autogen.sh
make
sudo make install

之后,关注源instructions

链接错误: 在构建 executable. 时链接 libprotobuf-c.so 失败

【讨论】:

    猜你喜欢
    • 2014-04-03
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    • 2017-10-19
    • 2017-04-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多