---
title: "centos 编译 安装 protobuf"
author: "libin123"
date: "2012-08-15T17:01:22Z"
tags: []
categories: ["操作系统"]
slug: "centos-protobuf"
draft: false
lastmod: "2012-08-15T17:01:22Z"
id: 1633079
url: "https://dbua.iteye.com/blog/1633079"
---

yum -y install gcc+ gcc-c++

yum -y install make

下载protobuf-2.4.1.tar.gz：  
[http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz](http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz)  
安装：  
tar zxvf protobuf-2.4.1.tar.gz  
cd protobuf-2.4.1  
./configure  
make  
make check  
make install  
安装结束。  
验证：  
查看是否安装成功：protoc --version  
如果出现：libprotoc 2.4.1 则说明安装成功！  
如果出现错误： protoc: error while loading shared libraries: libprotobuf.so.0: cannot open

shared object file: No such file or directory

The issue is that Ubuntu 8.04 doesn't include /usr/local/lib in

library paths.

 

To fix it for your current terminal session, just type in

export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/usr/local/lib