Linux下protobuf的編譯與安裝

2022-05-06 19:12:10 字數 3119 閱讀 8223

unzip protobuf-2.5.0.zip
根目錄下沒有configure檔案,卻有乙個autogen.sh,原來是因為protobuf的編譯方式做了修改,要執行autogen.sh才會生成configure指令碼。

1 # check that gtest is present.  usually it is

already there since the

2 # directory is

set up as

an svn external.

3# 判斷是否存在gtest目錄

8#將解壓縮後的目錄改名為gtest

9 mv gtest-1.5.0

gtest

10 fi

解壓縮

1 unzip gtest-1.5.0

.zip

2 mv gtest-1.5.0 gtest

執行protobuf編譯

#執行autogen.sh生成configure

又是一堆的錯誤!!! 執行./autogen.sh時(用於產生configure,) 出現錯誤:

1 linux-lewph:/home/lewph/projects/system/build_tslib/tslib # ./autogen.sh

2 ./autogen.sh: line 4: autoreconf: command not found

缺少autoconf這個工具安裝:

1 yum install -y  autoconf
再次執行./autogen.sh問題又來了:

1 linux-lewph:/home/lewph/projects/system/build_tslib/tslib # ./autogen.sh

2 can'

t exec "aclocal": no such file or directory at /usr/share/autoconf/autom4te/fileutils.pm line 326.

3 autoreconf: failed to run aclocal: no such file or directory

1 linux-lewph:/home/lewph/projects/system/build_tslib/tslib # ./autogen.sh

2 can'

t exec "aclocal": no such file or directory at /usr/share/autoconf/autom4te/fileutils.pm line 326.

3 autoreconf: failed to run aclocal: no such file or directory   有這個檔案,推測,問題出現在exec "aclocal"這裡,

用cnf查一下,linux-lewph:/home/lewph/projects/system/build_tslib/tslib # cnf aclocal

the program '

aclocal

' can be found in

following packages:

* automake [ path: /usr/bin/aclocal, repository: zypp (repo-oss) ]

* automake [ path: /usr/bin/aclocal, repository: zypp (opensuse 11.2-0) ]

安裝依賴

1 yum  install automake
原來是要用到automake這個工具!安裝之!完成以後,再執行./autogen.sh .      問題還有!!!:

1 linux-lewph:/home/lewph/projects/system/build_tslib/tslib # ./autogen.sh

2 configure.ac:25

: error: possibly undefined macro: ac_disable_static

3 if this

token and others are legitimate, please use m4_pattern_allow.

4see the autoconf documentation.

5 configure.ac:26

: error: possibly undefined macro: ac_enable_shared

6 configure.ac:27

: error: possibly undefined macro: ac_libtool_dlopen

7 configure.ac:28

: error: possibly undefined macro: ac_prog_libtool

8 autoreconf: /usr/bin/autoconf failed with exit status: 1

這是缺少安裝包libtool-1.5.22.tar.gz 安裝

linux環境下protobuf安裝

1.到github 2.執行.autogen,生成configure 3.執行.configure prefix usr local protobuf配置安裝的路徑,生成makefile 4.執行 make 編譯用到c 11,保證g 的版本 4.7 5.執行make check 6.修改配置 exp...

linux下安裝protobuf教程 示例(詳細)

安裝步驟如下所示 tar xzf protobuf 2.1.0.tar.gz cd protobuf 2.1.0 configure prefix usr local protobuf make make check make install 2 sudo vim etc profile 新增 ex...

linux下安裝protobuf教程 示例(詳細)

並稍加修改。安裝步驟如下所示 tar zxvf protobuf 2.5.0.tar.gz cd protobuf 2.5.0 configure prefix usr local protobuf make make check make install 2 sudo vim etc profil...