在VC2005下编译libevent-2.0.6-rc

    技术2022-05-13  39

    一. 代码解压后需要进行的修改:

    1. 删除include/events下的event-config.h (以便使WIN32-Code/event2目录下的event-config.h生效).

     

    2.  WIN32-Code/event2目录下的event-config.h中增加定义

    #define _WIN32_WINNT 0x0500

     

    3. 在 event_iocp.c 文件开始增加

    #include "event2/event-config.h"

     

    二。命令行编译

    1. 执行VCVARS32.BAT建立编译环境

    2. 编译

    nmake /f Makefile.nmake libevent.lib

    nmake /f Makefile.nmake tests

    nmake /f Makefile.nmake all

     

    因为libevent是纯C的库,用VC6应该是可以编译的,

    试了一下发现一些类型(如intptr_t)没有定义, 因此用VC6编译需要更多一些改动


    最新回复(0)