diff -urN work.orig/CMakeLists.txt work/CMakeLists.txt
--- work.orig/CMakeLists.txt	2018-04-22 06:34:09.127722200 -0500
+++ work/CMakeLists.txt	2018-04-22 06:37:35.445261100 -0500
@@ -635,6 +635,8 @@
 # Following files need windows.h, so we should test it after windows.h test.
 LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H)
 LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H)
+# Only available on Windows 7 and above, so not possible with vc9.
+CHECK_FUNCTION_EXISTS(BCryptDeriveKeyPBKDF2 HAVE_BCRYPT_DERIVE_KEY_PBKDF2)
 
 #
 # Check whether use of __EXTENSIONS__ is safe.
diff -urN work.orig/libarchive/archive_cryptor.c work/libarchive/archive_cryptor.c
--- work.orig/libarchive/archive_cryptor.c	2018-04-22 06:33:58.190129600 -0500
+++ work/libarchive/archive_cryptor.c	2018-04-22 06:38:51.330777500 -0500
@@ -57,7 +57,7 @@
 	return 0;
 }
 
-#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H)
+#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) && defined(HAVE_BCRYPT_DERIVE_KEY_PBKDF2)
 #ifdef _MSC_VER
 #pragma comment(lib, "Bcrypt.lib")
 #endif
