title: Makefiles on windows with g++, linking a library
body: <p>I've gotten fed up with MSVC++6 and how everyone is always telling me that it's a crappy compiler and such.</p>
  
  <p>So now I've decided to try to use vim plus g++ and makefiles. Here's my problem; I have the following makefile:</p>
  
  <pre><code># This is supposed to be a comment..
  CC = g++
  # The line above sets the compiler in use..
  # The next line sets the compilation flags
  CFLAGS=-c -Wall
  
  all: main.exe
  
  main.exe: main.o Accel.o
      $(CC) -o main.exe main.o Accel.o 
  
  main.o: main.cpp Accel.h
      $(CC) $(CFLAGS) main.cpp
  
  Accel.o: Accel.cpp Accel.h
      $(CC) $(CFLAGS) Accel.cpp
  
  clean:
      del main.exe *.o
  </code></pre>
  
  <p>This gives an error when trying to <code>make</code>, because I need to link to a windows library called <code>Ws2_32.lib</code>, which is needed by <code>Winsock2.h</code>, which I <code>include</code> in one of my <code>.h</code> files.</p>
  
  <p>So how do I do this? I've tried the <code>-l</code> option, but I can't make it work. How does it work with a path that has spaces?</p>