How to link ws2_32.lib in CLion?
已回答
I learned that liking ws2_32.lib is needed when I use winsock2.h.
However, I don't know how to link ws2_32.lib library in CLion.
Help me plz...
请先登录再写评论。
You need to link an executable to the ws2_32.lib library using the
target_link_libraries ()CMake command. More about the command: https://cmake.org/cmake/help/latest/command/target_link_libraries.html. Also here is our quick CMake tutorial which might be helpful: https://www.jetbrains.com/help/clion/quick-cmake-tutorial.html#libs.