【发布时间】:2018-06-12 14:48:21
【问题描述】:
我正在尝试通过 ZeroMQ 在节点之间进行通信。我需要发送struct 的:
struct Content{
std::vector<cv::Mat> image;
std::string msg;
};
我尝试使用msgpack:
Content content;
content.image = msg2;
content.mesaj = "naber kardes";
msgpack::type::tuple<Content> src(content);
// serialize the object into the buffer.
// any classes that implements
// write(const char*,size_t) can be a buffer.
std::stringstream buffer;
msgpack::pack(buffer, src);
cout << sizeof(buffer) << endl;
但它给出了:
/usr/local/include/msgpack/v1/object.hpp:631:11:错误:“内容”中没有名为“msgpack_pack”的成员
还是 C++ 新手。
如何在 msgpack 的帮助下通过 ZeroMQ 发送我的内容结构?
【问题讨论】: