diff --git a/src/lib/utils/filesystem.cpp b/src/lib/utils/filesystem.cpp
index 053c91e..8e0a271 100644
--- a/src/lib/utils/filesystem.cpp
+++ b/src/lib/utils/filesystem.cpp
@@ -9,8 +9,10 @@
 #include <botan/internal/filesystem.h>
 #include <algorithm>
 
+#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
+
 #if defined(BOTAN_TARGET_OS_HAS_STL_FILESYSTEM_MSVC) && defined(BOTAN_BUILD_COMPILER_IS_MSVC)
-  #include <filesystem>
+  #include <experimental/filesystem>
 #elif defined(BOTAN_HAS_BOOST_FILESYSTEM)
   #include <boost/filesystem.hpp>
 #elif defined(BOTAN_TARGET_OS_HAS_POSIX1)
@@ -38,7 +40,7 @@ std::vector<std::string> impl_stl_filesystem(const std::string& dir)
 #if (_MSVC_LANG >= 201703L)
    using namespace std::filesystem;
 #else
-   using namespace std::tr2::sys;
+   using namespace std::experimental::filesystem;
 #endif
 
    std::vector<std::string> out;