linux平台下ZeroMQ zmq(C++)编译安装以及调用

安装

  1. 下载源码
    进入官网:https://github.com/zeromq/libzmq,解压到指定目录。

  2. 编译安装
    进入libzmq解压后的目录,执行以下命令:

./autogen.sh
./configure
make
sudo make install

说明: 某些情况下可能需要使用libsodium加密库替换默认内置的tweetnacl加密库,则需要加上选项–with-libsodium(需要安装libsodium),大部分情况下不需要该选项。、

sudo ldconfig

默认路径在/opt/zmq下面,编译直接调用即可

问题排查

  1. ./configure 生成makefile 如果报错:
sudo apt-get install g++
sudo apt-get install libuuid-devel
  1. 执行./autogen.sh时出现报错

autogen.sh: error: could not find pkg-config. pkg-config is required to run autogen.sh.

sudo apt-get install pkg-config

autogen.sh: error: could not find libtool. libtool is required to run autogen.sh

sudo apt-get install libtool-bin
sudo apt-get install libtool

autogen.sh:error: could not find autoreconf. autoconf and automake are required to runautogen.sh

sudo apt-get install autoreconf*

你可能感兴趣的:(c++开发,linux,zmq编译,c++,安装zeromq,调用)