Como vincular ws2_32 no Clion
Estou usando o Clion, que usa MinGW e Cmake. Quando tento usar o standaloneasio
biblioteca que estou recebendo
undefined reference to `WSAStartup@8'
undefined reference to `WSASetLastError@4'
undefined reference to `closesocket@4'
...
Eu acredito que tenho que ligar oC:/Windows/System32/ws2_32.dll
biblioteca. Eu tentei adicionar algo como-L C:/Windows/System32 -lws2_32
:
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS} -static -lws2_32")
Mas isso não ajudou. Como posso corrigir esses erros?