ZeroMQ 链接器错误 C++

发布于 2024-10-08 01:56:36 字数 369 浏览 0 评论 0原文

我收到以下错误:

“错误 1 ​​错误 LNK2019:无法解析的外部符号 _imp_zmq_init 在函数“public: __thiscall zmq::context_t::context_t(int)”中引用 (??0context_t@zmq@ @QAE@H@Z) ZeroMQPlay.obj ZeroMQPlay"

使用此 C++ 代码:

include "stdafx.h"
include <zmq.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
 zmq::context_t ctx(1);

 return 0;
}

救命!

I get the following error:

"Error 1 error LNK2019: unresolved external symbol _imp_zmq_init referenced in function "public: __thiscall zmq::context_t::context_t(int)" (??0context_t@zmq@@QAE@H@Z) ZeroMQPlay.obj ZeroMQPlay"

With this C++ code:

include "stdafx.h"
include <zmq.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
 zmq::context_t ctx(1);

 return 0;
}

Heelp!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水溶 2024-10-15 01:56:36

您必须告诉链接器有关 ZeroMQ 库的信息。如果您已将 ZeroMQ 构建为 VS 项目,最简单的方法是将 ZeroMQ 项目添加到包含您自己的项目的解决方案中,并将您的项目标记为依赖于它。

You have to tell the linker about the ZeroMQ library. If you've built ZeroMQ as a VS project, the easiest way is to add the ZeroMQ project to the solution containing your own project and mark your project as dependent on it.

懵少女 2024-10-15 01:56:36

Afaiu 你应该首先构建 Zeromq 库,并将其与你的应用程序链接。

Afaiu you're supposed to build the zeromq library first, and link it with your app.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文