在VS2012 C ++中使用ZeroMQ [英] Using ZeroMQ in VS2012 C++

查看:692
本文介绍了在VS2012 C ++中使用ZeroMQ的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我安装了ZeroMQ在python(和它的工作),但我不能在Visual studio 2012 C ++。我下载了windows安装程序,安装它,并在安装文件夹中搜索:



- include文件夹与2个头文件,我复制到我的VS包括



-alib文件夹包含3个lib文件和3个pdb文件,我复制到我的VS库中



-abin文件夹,我复制到我的VS bin



之后,我试图使用zmq :: context_t ...和zmq :: socket_t ...但我不能这样做,它说,zmq必须是一个类,为了使我作为一个命名空间。我试图添加所有的库到依赖项,但仍然不能做。



所以,之后,我复制了到一个zmqhpp.h文件,我导入到我想要创建套接字的其他头文件。
现在它说1> PythonPlugIn2.obj:error LNK2019:unresolved external symbol _ imp _zmq_close在函数public:void __thiscall zmq :: socket_t :: close(void) ?关闭@ socket_t @ zmq @@ QAEXXZ)和一堆其他未解决的问题(12更准确)





我在Windows 7 x-64和Visual Studio 2012 c ++上



p>

编辑:我试过另一件事。而不是Windows安装程序,我下载了.zip。我遵循每一步(我不得不构建msvc10,因为msvc不会构建),然后我添加库libzmq_d.lib到我的依赖项。我仍然收到错误zmq不是类或命名空间名称



Edit2:尝试这也。没有...

解决方案

当我得到类似的错误是因为我试图将64位库链接到32位项目。我已经下载了错误的版本。当我得到正确的,即x86而不是x64,它工作。


So i installed the ZeroMQ in python(and it's working) but i can't do it in Visual studio 2012 C++. I downloaded the windows installer, installed it and searched in the installation folder which is:

-an "include" folder with 2 header files which i copied into my VS include

-a "lib" folder with 3 lib files and 3 pdb files which i copied into my VS lib

-a "bin" folder which i copied into my VS bin

After this, i tried to use zmq::context_t... and zmq::socket_t... but i couldn't do it, it said that zmq had to be a class in order for me to use as a namespace. I tried to add all the libraries to the dependencies and still couldn't do it.

So, after, i copied this to a zmqhpp.h file which i imported to my other header file where i want to create the socket. Now it says "1>PythonPlugIn2.obj : error LNK2019: unresolved external symbol _imp_zmq_close referenced in function "public: void __thiscall zmq::socket_t::close(void)" (?close@socket_t@zmq@@QAEXXZ)" and a bunch of other "unresolved" problems(12 more to be exact)

What's happening guys?

I'm on windows 7 x-64 and on Visual Studio 2012 c++

Thank you guys

Edit: Meanwhile i tried another thing. Instead of the windows installer i downloaded the .zip. I followed every step(i had to build the msvc10 because the msvc wouldn't build) and then i added the library libzmq_d.lib to my dependencies. I still get the error "zmq is not a class or namespace name"

Edit2: Tried this also. Nothing...

解决方案

When I got similar errors it was because I was trying to link the 64-bit libraries into a 32-bit project. I had downloaded the wrong version. When I got the right ones, ie x86 instead of x64, it worked.

这篇关于在VS2012 C ++中使用ZeroMQ的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆