How to build a bufferevent-enabled Tor on windows XP in way too many easy steps You will need: - The latest version of: - MinGW, openssl, zlib, libevent (at least version 2.0.12 or a git checkout that includes my patches), tor (at least version 0.2.3.1 or a git checkout of the master branch) - Windows XP - time You will want to: - Install MinGW into C:\MinGW. If you pick a different path, pick one without spaces. During the installation, make sure you select the msys option, it is disabled by default. - Start a MinGW Shell: Start -> All Programs -> MinGW Shell - Use the mingw-get tool to install a bunch of required programs: $ mingw-get install autoconf automake libtool msys-wget msys-vim - make a build directory, fetch zlib, openssl and libevent. Extract. - build & install zlib. Enjoy this straightforward procedure. Don't export any of the variables or you might have fun conflicts later: $ BINARY_PATH=/usr/local/bin INCLUDE_PATH=/usr/local/include \ LIBRARY_PATH=/usr/local/lib make -f win32/Makefile.gcc $ BINARY_PATH=/usr/local/bin INCLUDE_PATH=/usr/local/include \ LIBRARY_PATH=/usr/local/lib make install -f win32/Makefile.gcc - patch openssl to create useful DLLs (if you don't do this, DLLs will be created for you. Unfortunately, they won't contain any exported symbols and are thus pretty worthless): $ vim Configure look for this line (without the '): '"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",' and replace it with: '"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin -Wl,--export-all -shared:.dll.a",' in short, add ' -Wl,--export-all -shared' between '-mno-cygwin' and ':.dll.a",'. I got the idea for this from http://wagner.pp.ru/~vitus/articles/openssl-mingw.html - thanks! - build & install openssl. This is relatively easy, but takes a while. Do not attempt to pass a -j flag to make: That might randomly break the build. The ./config flags are just a suggestion, these worked for me. $ ./config -shared -no-man -no-idea -no-rc5 -no-mdc2 $ make depend $ make $ make install - Copy the DLLs that got created into a system directory, so they are actually found when needed: $ cp /usr/local/ssl/bin/*.dll /c/WINDOWS/system32/ - build and install libevent: $ ./autogen.sh Run the above only if you don't build from a tarball $ export CPATH=/usr/local/ssl/include:/usr/local/include $ export LPATH=/usr/local/lib:/usr/local/ssl/lib $ ./configure --enable-gcc-warnings $ make $ make verify $ make install - build and test tor: $ ./autogen.sh Run the above only if you don't build from a tarball $ ./configure --enable-gcc-warnings --enable-bufferevents \ --enable-static-libevent --with-libevent-dir=/usr/local/ \ --with-zlib-dir=/usr/local/ \ --with-openssl-dir=/usr/local/ssl/ $ make $ make test