CLION: undefined reference to __imp_socket Clion 运行socket程序出现如此报错, 解决方法, 在CMakeList中加入 if(MINGW) target_link_libraries(yourTargetName ws2_32) endif()