diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 95eece17470a..258f14fb18ab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -140,6 +140,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") string(APPEND LEAN_EXTRA_LINKER_FLAGS " -Wl,--stack,${LEAN_WIN_STACK_SIZE}") set(EXTRA_UTIL_LIBS ${EXTRA_UTIL_LIBS} -lpsapi) endif() + # Link against winsock2 + string(APPEND LEAN_EXTRA_LINKER_FLAGS " -lws2_32") string(APPEND LEAN_EXTRA_CXX_FLAGS " -D LEAN_WINDOWS -D LEAN_WIN_STACK_SIZE=${LEAN_WIN_STACK_SIZE}") # do not import the world from windows.h using appropriately named flag string(APPEND LEAN_EXTRA_CXX_FLAGS " -D WIN32_LEAN_AND_MEAN") diff --git a/stage0/src/CMakeLists.txt b/stage0/src/CMakeLists.txt index 95eece17470a..258f14fb18ab 100644 --- a/stage0/src/CMakeLists.txt +++ b/stage0/src/CMakeLists.txt @@ -140,6 +140,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") string(APPEND LEAN_EXTRA_LINKER_FLAGS " -Wl,--stack,${LEAN_WIN_STACK_SIZE}") set(EXTRA_UTIL_LIBS ${EXTRA_UTIL_LIBS} -lpsapi) endif() + # Link against winsock2 + string(APPEND LEAN_EXTRA_LINKER_FLAGS " -lws2_32") string(APPEND LEAN_EXTRA_CXX_FLAGS " -D LEAN_WINDOWS -D LEAN_WIN_STACK_SIZE=${LEAN_WIN_STACK_SIZE}") # do not import the world from windows.h using appropriately named flag string(APPEND LEAN_EXTRA_CXX_FLAGS " -D WIN32_LEAN_AND_MEAN")