title: How to link ws2_32 in Clion
body: <p>I am using Clion, which uses MinGW and Cmake. When I try to use the standalone <code>asio</code> library I am getting </p>
  
  <pre><code>undefined reference to `WSAStartup@8'
  undefined reference to `WSASetLastError@4'
  undefined reference to `closesocket@4'
  ...
  </code></pre>
  
  <p>I believe I have to link the <code>C:/Windows/System32/ws2_32.dll</code> library. I tried adding something like <code>-L C:/Windows/System32 -lws2_32</code>:</p>
  
  <pre><code>set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS} -static -lws2_32")
  </code></pre>
  
  <p>But that didn't help. How can I fix these errors ?</p>