Skip to content

Instantly share code, notes, and snippets.

@limingjie
Last active March 16, 2018 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save limingjie/bcbdccd8ab1e3269b282 to your computer and use it in GitHub Desktop.
Save limingjie/bcbdccd8ab1e3269b282 to your computer and use it in GitHub Desktop.
Build libevent 2.0.22 with MinGW

Build libevent 2.0.22 with MinGW

  • Download
http://jaist.dl.sourceforge.net/project/levent/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz
  • Build
$ ./configure --prefix=/mingw
$ ./configure && make
$ make install
@Jan200101
Copy link

The download link didnt work but a manual download from Sourceforge worked fine.
👍

@monkins1010
Copy link

Cant seem to build libevent for mingw32... tried 2.0.22 and the newer 2.1.8 I get

make[2]: Entering directory /home/Chris/libevent' /bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -IWIN32-Code -g -O2 -Wall -fno-strict-aliasing -MT listener.lo -MD -MP -MF .deps/listener.Tpo -c -o listener.lo listener.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -IWIN32-Code -g -O2 -Wall -fno-strict-aliasing -MT listener.lo -MD -MP -MF .deps/listener.Tpo -c listener.c -DDLL_EXPORT -DPIC -o .libs/listener.o listener.c: In function 'start_accepting': listener.c:568:16: error: 'ERROR_IO_PENDING' undeclared (first use in this function) if (error != ERROR_IO_PENDING) { ^~~~~~~~~~~~~~~~ listener.c:568:16: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [listener.lo] Error 1 make[2]: Leaving directory /home/Chris/libevent'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/Chris/libevent'
make: *** [all] Error 2

@laptrinhbockchain
Copy link

I also same error when building libevent-2.1.8 with mingw32.
I fixed this error by adding the following code into the bottom of file "config.h":
#include <winerror.h>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment