[英]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. 虽然我的主要专业领域不是
Visual Studio 2015
安装/项目配置,但我在加载/配置ZeroMQ
项目时遇到了麻烦。
How to proceed correctly on loading a ZeroMQ
Project? 如何正确加载
ZeroMQ
项目?
Observed errors: 观察到的错误:
cmake
errors cmake
错误 ZeroMQ
Installer does not support Visual Studio v14 ZeroMQ
Installer不支持Visual Studio v14 Instructions would be awesome, as it seems that there is no other source of documentation for this situation on the internet. 说明会很棒,因为在互联网上似乎没有其他文件来源。
Had the same problem a while ago. 刚才有同样的问题。 Here is what I did to solve this:
以下是我为解决这个问题所做的工作:
The "download link" provided on the ZMQ website seems outdated. ZMQ网站上提供的“下载链接”似乎已经过时。 To really get the current version you would have to use Git:
要真正获得当前版本,您必须使用Git:
git clone https://github.com/zeromq/libzmq.git
The repository comes with a pre-build Visual Studio project. 存储库附带预构建的Visual Studio项目。 You can find it in
...\\libzmq\\builds\\msvc
. 您可以在
...\\libzmq\\builds\\msvc
找到它。 To build for Visual Studio 2015 cd
into vs2015
and open libzmq.sln
. 要将Visual Studio 2015
cd
构建到vs2015
并打开libzmq.sln
。
You can choose if you want to compile static or dynamic libraries: DynRelease
or StaticRelease
for either Win32 or x64. 您可以选择是否要编译静态库或动态库:Win32或x64的
DynRelease
或StaticRelease
。
After that, run Build > Build solution
to compile everything. 之后,运行
Build > Build solution
来编译所有内容。
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. C++ > General > Additional Include Directories
应指向存储库的包含路径。 If you want to use C++ style some additional files have to be placed in this directory. 如果要使用C ++样式,则必须在此目录中放置一些其他文件 。 Alternatively you can take a look at https://github.com/zeromq/zmqpp .
或者,您可以查看https://github.com/zeromq/zmqpp 。
Linker > General > Additional Library Directories
should point to the built libraries. Linker > General > Additional Library Directories
应指向构建的库。 They should be located at ...\\libzmq\\bin\\x64\\Release\\v140\\dynamic\\
. 它们应位于
...\\libzmq\\bin\\x64\\Release\\v140\\dynamic\\
。
Linker > Input > Additional Dependencies
should contain the name of the library you want to use. Linker > Input > Additional Dependencies
应包含要使用的库的名称。 The default should be libzmq.lib
, otherwise you will find the name in the bin
directory. 默认值应为
libzmq.lib
,否则您将在bin
目录中找到该名称。
The program depends on the libzmq.dll
file you just built. 该程序取决于您刚刚构建的
libzmq.dll
文件。 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
: 要实现此目的,您可以将以下命令添加到
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. 如果缺少,则会将.dll文件复制到每个构建的目标目录中。
Hope this helps =) 希望这有助于=)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.