title: How to link wsock32 library through g++?
body: <p>I'm using minGW on windows, trying to compile a c++ program. I've used sockets in there, so I'm trying to link (not include... I've already included winsock.h) the wsock32 library. I know that the -L switch is for linking but none of the following commands work:</p>
  
  <pre><code>g++ C:\program.cpp -Lwsock32.lib
  g++ C:\program.cpp -LC:\windows\system32\wsock32.dll
  g++ C:\program.cpp -lC:\windows\system32\wsock32.dll
  g++ C:\program.cpp -LC:\windows\system32\wsock32.lib
  </code></pre>
  
  <p>what should I do??</p>