diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11b440aab8c247839ab27e27c67dcd05d1114daa..8e6c8b91d0e7064a78ec98248a2fef11da535e20 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -779,6 +779,10 @@ if(MSVC)
   list(APPEND EXTERNAL_LIBRARIES "ws2_32")
 endif(MSVC)
 
+if(WIN32 AND NOT HAVE_FLTK)
+  list(APPEND EXTERNAL_LIBRARIES "ws2_32 wsock32")
+endif(WIN32 AND NOT HAVE_FLTK)
+
 list(SORT CONFIG_OPTIONS)
 set(GMSH_CONFIG_OPTIONS "")
 foreach(OPT ${CONFIG_OPTIONS})