--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -128,6 +128,8 @@
 endif
 
 libgdiplus_la_LIBADD = $(GDIPLUS_LIBS)
+
+libgdiplus_la_LDFLAGS = -no-undefined
 
 AM_CPPFLAGS = $(GDIPLUS_CFLAGS)
 
--- a/configure.ac
+++ b/configure.ac
@@ -9,6 +9,7 @@
 AM_INIT_AUTOMAKE([foreign tar-ustar])
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE
+AC_LIBTOOL_WIN32_DLL
 AC_PROG_CXX
 AM_PROG_LIBTOOL
 
