VS2015编译生成nanomsg库文件

   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

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值