Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up [ ZeroMQ ] for use in a Visual Studio 2015 Enterprise?

While my primary domain of expertise is not Visual Studio 2015 setup / project configuration, I have experienced troubles on loading / configuring ZeroMQ project.

How to proceed correctly on loading a ZeroMQ Project?

Observed errors:

  • current build on github and even old "stable" versions cause cmake errors
  • ZeroMQ Installer does not support Visual Studio v14

Instructions would be awesome, as it seems that there is no other source of documentation for this situation on the internet.

like image 939
StackOverflowOverflow Avatar asked May 30 '16 22:05

StackOverflowOverflow


People also ask

What is ZeroMQ used for?

ZeroMQ is a library used to implement messaging and communication systems between applications and processes - fast and asynchronously.

Is ZeroMQ still maintained?

ZeroMQ still works great and the open source community is still maintaining it on GitHub [3].


1 Answers

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 =)

like image 105
Byomeer Avatar answered Oct 30 '22 01:10

Byomeer