ZMQ 4.1.3 Ubuntu中的基本示例运行错误

时间:2015-09-01 04:15:35

标签: ubuntu zeromq

我试图在Ubuntu中使用zmq 4.1.3。

我按照以下命令安装了zmq。

./autogen.sh
./configure && make check
sudo make install
sudo ldconfig

当我指定安装的zmq 4.1.3的位置时,我收到了核心转储消息。但是,如果我不告诉zmq的位置,它运作良好。

总之,

examples works well with zmq in /usr/lib/x86_64-linux-gnu/
libzmq.so.1 => /usr/lib/x86_64-linux-gnu/libzmq.so.1 (0x00007f58e4ff9000)

示例不适用于/ usr / local / lib(新安装的目录)中的zmq

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# g++ hwserver.cpp -o main -lzmq -L/usr/local/lib

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# g++ hwclient.cpp -o main2 -lzmq -L/usr/local/lib

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# ./main&
[1] 27017

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# ./main2

Connecting to hello world server...
Sending Hello 0...
Received Hello

main: /usr/include/zmq.hpp:131: zmq::message_t::~message_t(): Assertion `rc == 0' failed.

Received World 0

main2: /usr/include/zmq.hpp:131: zmq::message_t::~message_t(): Assertion `rc == 0' failed.

Abort (core dumped)

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# g++ hwclient.cpp -o main2 -lzmq
[1]+  Abort               (core dumped) ./main

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# g++ hwclient.cpp -o main2 -lzmq

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# g++ hwserver.cpp -o main -lzmq

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# ./main&
[1] 27066

root@jangho-Z87M-HD3:/zeromq/zguide/examples/C++# ./main2

Connecting to hello world server...
Sending Hello 0...
Received Hello
Received World 0
Sending Hello 1...

0 个答案:

没有答案