One will get errors like "undefined reference to __imp_htonl" when
trying to build libev with MinGW on Windows. This patch fixes this by
linking to ws2_32, which provides winsock functions.
---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 299e5cf..07c4dff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -196,6 +196,10 @@ if(BUILD_SHARED_LIBS)
         target_link_libraries(ev ${LIBRT_NAME} ${LIBM_NAME})
     endif()
 
+    if (MINGW)
+        target_link_libraries(ev ws2_32)
+    endif()
+
     create_libtool_file(ev_static /lib)
 
     install(TARGETS ev LIBRARY DESTINATION lib)
-- 
2.26.2


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/libev

Reply via email to