diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a9982b9..d4e684c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -26,7 +26,7 @@ endif()
 
 find_package(CURL REQUIRED)
 
-add_executable(httplib-test test.cc)
+add_executable(httplib-test test.cc include_httplib.cc $<$<BOOL:${WIN32}>:include_windows_h.cc>)
 target_compile_options(httplib-test PRIVATE "$<$<CXX_COMPILER_ID:MSVC>:/utf-8;/bigobj>")
 target_link_libraries(httplib-test PRIVATE httplib GTest::gtest_main CURL::libcurl)
 gtest_discover_tests(httplib-test)
diff --git a/test/include_windows_h.cc b/test/include_windows_h.cc
new file mode 100644
index 0000000..44f541f
--- /dev/null
+++ b/test/include_windows_h.cc
@@ -0,0 +1,6 @@
+// Test if including windows.h conflicts with httplib.h
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <httplib.h>