On Thu, May 14, 2009 at 04:58:02PM -0700, Rush Manbert wrote: > Hi, > > I have done some searching and have read a couple of posts on this > subject, but nothing that quite answers my questions. > > I am writing a Windows port of the Thrift RPC library > (http://incubator.apache.org/thrift/ ) that will build in Visual Studio > with no Cygwin or other *nix/Posix emulation required. Thrift uses > libevent, so I tried to build the same sort of version of libevent. > > I was surprised to find that libevent would not build out of the box > on Windows using Visual Studio. However, once I found an open source > version of stdint.h for use in Visual Studio, I was able to get the > 1.4.10 stable version building fairly easily. Once the library built, > I was able to build and successfully execute the regression test using > the same technique. The other tests weren't so successful due to > missing vcproj files. I just opened up a WinXP VM, fired up Visual C++ 2008 Express, checked out the 1.4 branch, and tried to build from the project file in Svn. It converted mostly okay. I ran into a few warnings when I built it, but no errors. It seems to have worked fine for me. (I fixed the warnings and checked the modified code back in.)
Then I tried it with the distributed version. Ouch! Apparently, we have not been including the event-config.h file that is supposed to be in WIN32-Code for VC libevent builds... but we _have_ been including the generated event-config.h that shouldn't actually be distributed; only installed. I've cleaned up the code that builds the distribution. (It wasn't an absence of stdint.h; Libevent works around the fact that 10 years out, MS still hasn't seen fit to implement C99. But using the wrong event-config.h made libevent act as if it had stdint.h when it didn't, which was the problem.) > I have two questions: > > 1) Why doesn't libevent as released just build in Visual Studio if > this was so easy to accomplish for me? Or have I missed something? Apparently, nobody who knew how Libevent was _supposed_ to build with Visual Studio had tried building with Visual Studio using a source distribution for a long time. We suck at paying attention to Visual Studio. [How it's _supposed_ to work is this: on everywhere that has a shell that can handle autoconf, the autoconf script detects the system settings and generates a config.h file, which gets post-processed into a event-config.h automatically. On anywhere without a shell that can handle autoconf (this is basically only Visual Studio), we use a pre-generated event-config.h file that has the right settings for Windows on Visual Studio's idea of C.] > 2) I would be happy to provide a patch that adds this support. Are any > of the developers interested in receiving it? Give 1.4.11 a try when it comes out some time in the next 24 hours; let us know if it's any better for you? (Also, once 2.0.2-alpha is out, somebody needs to work on decent project files for the 2.0.x series. The ones we have now are kind of stupid and crufty.) apologies, -- Nick _______________________________________________ Libevent-users mailing list Libevent-users@monkey.org http://monkeymail.org/mailman/listinfo/libevent-users