title: How to fix undefined reference to `__imp_WSACleanup' (Boost.Asio) in CLion
body: <p>My C++ project includes <a href="http://www.boost.org/" rel="nofollow">Boost</a> and <a href="https://github.com/zaphoyd/websocketpp" rel="nofollow">WebSocket++</a> libs. I read other topics I need to add <code>-lws2_32</code> to gcc command, but I've CLion and I don't know how to fix it.</p>
  
  <p>Console:</p>
  
  <pre><code>CMakeFiles\WsServer.dir/objects.a(main.cpp.obj): In function `boost::asio::detail::winsock_init_base::startup(boost::asio::detail::winsock_init_base::data&amp;, unsigned char, unsigned char)':
  C:/MinGW/include/boost/asio/detail/impl/winsock_init.ipp:39: undefined reference to `__imp_WSAStartup'
  CMakeFiles\WsServer.dir/objects.a(main.cpp.obj): In function `boost::asio::detail::winsock_init_base::cleanup(boost::asio::detail::winsock_init_base::data&amp;)':
  C:/MinGW/include/boost/asio/detail/impl/winsock_init.ipp:56: undefined reference to `__imp_WSACleanup'
  collect2.exe: error: ld returned 1 exit status
  mingw32-make.exe[3]: *** [CMakeFiles\WsServer.dir\build.make:99: WsServer.exe] Error 1
  mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:67: CMakeFiles/WsServer.dir/all] Error 2
  mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:79: CMakeFiles/WsServer.dir/rule] Error 2
  mingw32-make.exe: *** [Makefile:117: WsServer] Error 2
  </code></pre>
  
  <p>What I should do?</p>