如何在 CentOs(或任何 LINUX/UNIX 系统)上构建/安装 protobuf 2.4.1?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9410179/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I build/install protobuf 2.4.1 on CentOs (or any LINUX/UNIX system)?
提问by user113454
Ok, so I'm kind of a complete foreigner in the UNIX/LINUX land, but I need to install profbuf 2.4.1.
好的,所以我是 UNIX/LINUX 领域的完全外国人,但我需要安装 profbuf 2.4.1。
I was following the instructions by doing
我按照说明做
- wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
- tar xfj protobuf-2.4.1.tar.bz2
- pushd protobuf-2.4.1
- ./configure
- make
- sudo make install
- wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
- tar xfj protobuf-2.4.1.tar.bz2
- 推送 protobuf-2.4.1
- 。/配置
- 制作
- 须藤制作安装
I could only go as far as ./configure'. WHen I tried running
make`, I got some error saying "No target specified and no makefile found... Stop"
我只能使用./configure'. WHen I tried running
make`,出现一些错误提示“未指定目标且未找到 makefile...停止”
Does anyone know what I might've done wrong?
有谁知道我可能做错了什么?
Thanks!!!
谢谢!!!
回答by Chenk
I had met the same question before, and now I've known the reason. It's lack of corresponding library. If you are using redhat, use root permission to enter the two lines of commands:
我以前也遇到过同样的问题,现在我知道原因了。缺少相应的库。如果你使用的是redhat,使用root权限输入两行命令:
# yum install glibc-headers
# yum install gcc-c++
If you are using ubuntu,you can enter this:
如果您使用的是 ubuntu,则可以输入:
# sudo apt-get install build-essential
I've solved my question by that way. Wish you luck!
我已经通过这种方式解决了我的问题。祝你好运!
回答by user3312094
You probably don't have a g++ compiler in your system or your environment variable doesn't contain the path of it. To install one on linux use the following:
您的系统中可能没有 g++ 编译器,或者您的环境变量不包含它的路径。要在 linux 上安装一个,请使用以下命令:
yum install gcc-c++