问题
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...
回答1:
It may be that your search directories for linking don't include the C DLL libzmq.dll
. Verify that this isn't the problem.
回答2:
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.
来源:https://stackoverflow.com/questions/17396922/using-zeromq-in-vs2012-c