[zeromq-dev] Using ZeroMQ in VS2012 C++

Shon Love slove at fatpot.com
Thu Jul 11 22:14:36 CEST 2013


  To use the ZeroMQ stuff from the installer (for Windows/C++/Visual
Studio), you need to make sure the project you're working on has the 0mq
'include' folder in the include path, the 'lib' folder in the libraries
path, the actual library (.lib) file whose dll you'll be using must be in
the additional includes for the exe, and the dll file must be in the path
for the exe when you run the application (phew!)


  1. Add the path to 0mq's 'include' folder to your project's include path.
  2. Add the path to 0mq's 'lib' folder to your project's additional
library path.
  3. Add the libzmq<whatever>.lib file to the list of additional libraries
your exe will link against.
  4. Make sure the libzmq<whatever>.dll file is in the PATH for your
application's exe when it is run.  For debugging, I often copy the
appropriate .dll file into the build folder for the application, but
installing the libzmq*.dll files into the normal execution path works, too.

  Hope you can make sense of any of that :)


On Wed, Jul 10, 2013 at 8:50 PM, João Malés <jpmp9 at hotmail.com> wrote:

> Hello
> Someone advised me to join this mailing list to solve my problem. I
> already tried the ZeroMq Dashboard, the StackoverFlow, MSDN and other sites
> with no luck.
> So this is it:
> 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(
> https://github.com/zeromq/cppzmq/blob/master/zmq.hpp) 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 at socket_t@zmq@@QAEXXZ)" and a bunch of
> other "unresolved" problems(12 more to be exact)
> 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"
> Edit:Tried this(
> http://stackoverflow.com/questions/10367678/linking-to-a-static-0mq-library-in-vs?lq=1)
> also. Nothing...
> What's happening guys?
> I'm on windows 7 x-64 and on Visual Studio 2012 c++
> Thank you for the help
> João Pereira
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Shon C. Love
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130711/d882d2fd/attachment.htm>

More information about the zeromq-dev mailing list