1、下载ZeroMQ(如果下面的命令下载的太慢,就自己百度下载一个zeromq-2.1.7.tar.gz,然后上传到虚拟机里面)
wget http://download.zeromq.org/zeromq-2.1.7.tar.gz
2、解压ZeroMQ,重命名
$ tar zvxf zeromq-2.1.7.tar.gz
$ mv zeromq-2.1.7.tar.gz zeromq
$ cd zeromq
3、编译安装
$ ./configure
......
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/chuser/zeromq':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
提示缺少C编译器,先安装GCC。
$ sudo yum install gcc
安装OK!再次执行
$ ./configure
......
checking whether the C++ compiler works... no
configure: error: Unable to find a working C++ compiler
提示缺少C++编译器,先安装G++。
$ sudo yum install gcc-c++
安装OK!再次执行
......(省略一部分)
checking whether to enable code coverage... no
checking for pthread_create in -lpthread... yes
checking for sem_init in -lrt... yes
checking for uuid_generate in -luuid... no
提示缺少uuid-dev,
这时千万不要去执行yum install uuid-dev,会报错!
而是执行下面的命令
yum install uuid*
./configure 再次运行configure还是报错
configure: error: cannot link with -luuid, install uuid-dev.
上网搜索可能是还缺另外一个包,执行下面的命令
yum install e2fsprogs*
./configure 再次运行configure还是报错
configure: error: cannot link with -luuid, install uuid-dev.
百度了下,还需要执行下面的命令:
yum install libuuid-devel
最后,执行./configure
成功了!!!