Windows下如何编译libevent
1、从Libevent官网主页或者github上将libevent源码包下载,默认名称为libevent-2.1.8-stable.tar,使用7zip或其他解压工具将其解压至磁盘任意目录。
2、打开VC2017开发命令行工具(点左下角Windows图标,选在Visual Studio 2017分支,点开"Developer Commmand prompt”),打开命令行工具。

3、使用cd 命令将当前工作目录转移到刚才解压的libevent源码主目录。这个目录下包含Makefile.nmake文件,执行命令nmake /f Makefile.nmake static_libs命令,将编译产生
libevent.lib
libevent_core.lib
libevent_extras.lib
三个文件。

4、其实libevent有几个编译选项可供选择,如下
All编译:nmake /f Makefile.nmake [all] //all可以省略,默认是all
静态库编译: nmake /f Makefile.nmake static_libs
测试程序编译:nmake /f Makefile.nmake tests
清理编译输出:nmake /f Makefile.nmake clean

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:150
阅读量:190
阅读量:74
阅读量:98
阅读量:58