2013-04-11 35 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.