nanomsg是zeromq的轻量级版本,并且使用的是C语言(目前还不太成熟).
具体的情况介绍 可以参考 nanomsg官网
以下介绍如何编译nanomsg的库文件的过程
1、下载nanomsg的代码 该代码放在github ( https://github.com/nanomsg/nanomsg/releases )
如下图:
2.下载并安装CMake工具 CMake官网
为什么要下载CMake,我们可以从官网中得到 http://nanomsg.org/download.html
CMake可以根据特定系统生成项目文件,如nanomsg官网提及的那样
POSIX Platforms
On POSIX platforms, nanomsg uses the standard autotools build procedure.
To build and install the library, unpack the package, ensure your system has a C compiler installed, and proceed with the following steps:
Run ./configure, then make to build the library.
Optionally, run make check to run the built-in test suite.
Run make install as root.
On Linux or other platforms which use ld.so for dynamic linking, run ldconfig or equivalent as root to update your systems shared library cache.
OSX platforms
OSX is a POSIX-compliant platform and so it should be built accordingly.
One special OSX feature though are universal libraries. If you want to build an universal library for both i386 and x86_64 architectures you should replace the ./configure line with the following:
CFLAGS="-arch i386 -arch x86_64" ./configure -disable-dependency-tracking
Windows Platforms
On Windows platforms, nanomsg uses the CMake build system.
To build and install the library, unpack the package, ensure your system has CMake and MSVC compiler installed, and proceed with the following steps:
Run cmake . to build the MSVC project.
Open the solution nanomsg.sln in MSVC IDE.
Build the entire solution.
Optionally, build RUN_TESTS project to run the test suite.
3.解压nanomsg压缩包
解压后如图
4.打开CMake工具
其中bin文件夹是自己新建的,主要用于后面存放生成的项目文件
4.点解"Configure"按钮
确认后,会出现如图现象
再次重新点击 "Configure"按钮
最后点击"Generate"按钮,生成项目文件,结果如下图
用VS2015打开 “nanomsg.sln” 文件工程,重新编译.即可产生nanomsg.dll与nanomsg.lib文件
来自:http://blog.csdn.net/lan120576664