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

1

8

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.

Whaley answered 30/5, 2016 at 22:4 Comment(4)
My problem is, that I cannot use ZMQ in VS 2015 (as the title says). And what I did so far doesn't matter as I pointed out the errors that cause this Question. I don't want you to recommend a book or tutorial. I want to avoid these errors and asked if anyone has experienced the same and could help me.Whaley
And btw: if i could describe my problem in detail I would propably be able to fix it myself. However, I don't have a clue and thats why I am asking you (I mean like not YOU in particular, as you don't seem to have the slightest idea)Whaley
No worries. Maybe read this help page: stackoverflow.com/help/on-topic Good luck!Roundish
The Question out of any doubts meets StackOverflow Community primary focus (cit.: "software tools commonly used by programmers" )Neoplasty
P
25

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

Potman answered 31/5, 2016 at 0:33 Comment(1)
This fails because, for some reason, the build requires libsodium to be present somewhere..Midvictorian

© 2022 - 2024 — McMap. All rights reserved.