--- a/include/log4cpp/Portability.hh
+++ b/include/log4cpp/Portability.hh
@@ -35,11 +35,7 @@
 #if defined(__OPENVMS__)
 #    include <log4cpp/config-openvms.h>
 #else
-#   if defined(__MINGW32__)
-#       include <log4cpp/config-MinGW32.h>
-#   else
-#       include <log4cpp/config.h>
-#   endif
+#    include <log4cpp/config.h>
 #endif
 #endif
 
--- a/include/log4cpp/Priority.hh
+++ b/include/log4cpp/Priority.hh
@@ -14,6 +14,10 @@
 #include <string>
 #include <stdexcept>
 
+#ifdef WIN32
+#define LOG4CPP_FIX_ERROR_COLLISION
+#endif
+
 /*
  * Optionally work around rudeness in windows.h on Win32.
  */
--- a/include/log4cpp/RemoteSyslogAppender.hh
+++ b/include/log4cpp/RemoteSyslogAppender.hh
@@ -21,6 +21,10 @@
 #include <netinet/in.h>
 #endif
 
+#ifdef WIN32
+typedef u_long in_addr_t;
+#endif
+
 #ifdef LOG4CPP_HAVE_SYSLOG
 #include <syslog.h>
 #else
--- a/src/DailyRollingFileAppender.cpp
+++ b/src/DailyRollingFileAppender.cpp
@@ -31,6 +31,8 @@
 
 #ifndef WIN32    // only available on Win32
 #include <dirent.h>
+#else
+#include <windows.h>
 #endif
 
 namespace log4cpp {
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -64,4 +64,4 @@
 liblog4cpp_la_SOURCES += SmtpAppender.cpp
 endif
 
-liblog4cpp_la_LDFLAGS = -version-info @LT_VERSION@
+liblog4cpp_la_LDFLAGS = -no-undefined -version-info @LT_VERSION@
--- a/src/PThreads.cpp
+++ b/src/PThreads.cpp
@@ -4,6 +4,7 @@
  * See the COPYING file for the terms of usage and distribution.
  */
 
+#define _GNU_SOURCE
 #include <log4cpp/threading/Threading.hh>
 #include <cstdlib>
 
--- a/src/StringUtil.cpp
+++ b/src/StringUtil.cpp
@@ -9,6 +9,10 @@
 #include <iterator>
 #include <stdio.h>
 
+#ifdef __MINGW32__
+#define LOG4CPP_HAVE_SNPRINTF
+#endif
+
 #if defined(_MSC_VER)
     #define VSNPRINTF _vsnprintf
 #else
