Windows Compilation problem

Marc Lehmann schmorp at
Wed Jun 4 22:27:37 CEST 2008

On Wed, Jun 04, 2008 at 04:19:36AM -0700, Matt Tolton <matt at> wrote:
> I'm having some trouble getting libev to compile on windows.  I am
> embedding it as recommended.  Here are the errors I receive initially:

for the NFDBITS issue, you could try out current CVS, which should contain an
(untested) workaround for that.

the io.h issue is surprising - with my microsoft sdk, I get those definitions
when I include windows.h with WIN32_LEAN_AND_MEAN - why it would require an
additional io.h include for you is puzzling.

> I poked around and discovered that the "io.h" header has the
> unreferenced functions.  I added that in my ev_cpp.c file above the
> ev.c include.  This reduced the errors to the following:

I think that's the way to go for the moment.

> lib\ev/ev.c(773) : warning C4806: '==' : unsafe operation: no value of type 'boo
> l' promoted to type 'int' can equal the given constant

Hmm, that might actually be a real bug... (it is of no consquence as long
as libev is used correctly, though).

> lib\ev/ev.c(981) : error C2664: 'ioctlsocket' : cannot convert parameter 3 from
> 'int *' to 'u_long *'

This is also a bug - could you check out CVS, which will have a
possible fix for that as well in a few minutes? (It also doesn't affect
correctness, when it compiles, as unsigned long is compatible to int on
windows for the values used).

> According to the docs, the NFDBITS problem should be fixed by defining
> EV_SELECT_USE_FD_SET, which seems to be defined automatically for
> windows.

It should, but the recent workaround for non-blocking connects apparentlsy
reintroduced the dependency on NFDBITS.

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list