2013-04-11 71 views
1
/usr/bin/ld: cannot find -lprotobuf-c 
collect2: ld returned 1 exit status 
make: *** [test_apl] Error 1 

这些是我得到的错误。如何在c语言中在ubuntu上安装lprotobuf-c

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

+0

您想安装失败'libprotobuf-c0',获取此库。 'apt-cache search protobuf'在这种情况下会有所帮助,暗示一个'Protocol Buffers C library' – Petesh 2013-04-11 07:16:34

回答

2

Right installation processprotobuf-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

用于链接错误: 链接的libprotobuf-c.so同时建设executable.