The declaration of 'environ' in putenv.c:40 leads to a warning about "inconsistent DLL binding" and then later to a link error in test-unsetenv.
This fixes it. 2011-09-17 Bruno Haible <br...@clisp.org> putenv: Support for MSVC. * modules/putenv (Depends-on): Add environ. * lib/putenv.c (environ): Disable declaration. * lib/unistd.in.h: Update comment. --- lib/putenv.c.orig Sat Sep 17 17:27:21 2011 +++ lib/putenv.c Sat Sep 17 17:25:41 2011 @@ -34,10 +34,12 @@ #include <string.h> #include <unistd.h> -#if HAVE_GNU_LD +#if _LIBC +# if HAVE_GNU_LD # define environ __environ -#else +# else extern char **environ; +# endif #endif #if _LIBC --- lib/unistd.in.h.orig Sat Sep 17 17:27:21 2011 +++ lib/unistd.in.h Sat Sep 17 17:24:17 2011 @@ -75,7 +75,8 @@ #endif /* mingw fails to declare _exit in <unistd.h>. */ -/* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>. */ +/* mingw, MSVC, BeOS, Haiku declare environ in <stdlib.h>, not in + <unistd.h>. */ /* Solaris declares getcwd not only in <unistd.h> but also in <stdlib.h>. */ /* But avoid namespace pollution on glibc systems. */ #ifndef __GLIBC__ --- modules/putenv.orig Sat Sep 17 17:27:21 2011 +++ modules/putenv Sat Sep 17 17:24:44 2011 @@ -7,6 +7,7 @@ Depends-on: stdlib +environ [test $REPLACE_PUTENV = 1] malloc-posix [test $REPLACE_PUTENV = 1] configure.ac: -- In memoriam Estella Agsteribbe <http://en.wikipedia.org/wiki/Estella_Agsteribbe>