From d0c55842ae4166ba6f7368fe8ced7900059a184e Mon Sep 17 00:00:00 2001 From: dudamao Date: Sun, 15 Jan 2023 22:00:37 +0800 Subject: [PATCH] add link libraries ws2_32, fix win32 compile error. when compiling under windows, socket function of send() and recv() is undefined. we should add link libraries.(https://stackoverflow.com/questions/2033608/mingw-linker-error-winsock) --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 191f24ed..a17d6863 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,6 +237,7 @@ add_library(gmssl ${src}) if (WIN32) + target_link_libraries(gmssl -lws2_32) elseif (APPLE) target_link_libraries(gmssl dl) target_link_libraries(gmssl "-framework Security")