Had the same problem a while ago. Here is what I did to solve this:
Download the right ZMQ version
The "download link" provided on the ZMQ website seems outdated.
To really get the current version you would have to use Git:
git clone https://github.com/zeromq/libzmq.git
Build with Visual Studio 2015
The repository comes with a pre-build Visual Studio project. You can find it in ...\libzmq\builds\msvc
. To build for Visual Studio 2015 cd
into vs2015
and open libzmq.sln
.
You can choose if you want to compile static or dynamic libraries: DynRelease
or StaticRelease
for either Win32 or x64.
After that, run Build > Build solution
to compile everything.
Setup project to use compiled libraries
After you created your project, go to the project's properties:
C++ > General > Additional Include Directories
should point to the include path of the repository. If you want to use C++ style some additional files have to be placed in this directory. Alternatively you can take a look at https://github.com/zeromq/zmqpp.
Linker > General > Additional Library Directories
should point to the built libraries. They should be located at ...\libzmq\bin\x64\Release\v140\dynamic\
.
Linker > Input > Additional Dependencies
should contain the name of the library you want to use. The default should be libzmq.lib
, otherwise you will find the name in the bin
directory.
The program depends on the libzmq.dll
file you just built. This file has to be placed within your project's build directory. To achieve this, you can add the following command to Build Events > Post-Build Event > Command Line
:
copy /Y "...\libzmq\bin\x64\Release\v140\dynamic\libzmq.dll" "$(OutDir)"
This will copy the .dll file to the destination directory on every build if it's missing.
Hope this helps =)