title: GTK+ compilation undefined reference C
body: <p>I'm trying to compile and link a simple program downloaded from the web to learn how to make a GUI using the <code>gtk+</code> library.</p>
  
  <p>Here is my makefile:</p>
  
  <pre><code>CC = gcc
  BIN = gtk_led
  SRC = main.c gtkled.c
  OBJ = main.o gtkled.o
  
  CPPFLAGS =-Wall -W -ansi -pedantic -O2 `pkg-config --cflags gtk+-2.0`
  
  LDFLAGS = `pkg-config --libs gtk+-2.0`
  
  all: $(BIN)
  
  $(BIN): $(SRC)
  $(CC) $(CPPFLAGS) -c $(SRC)
  $(CC) $(LDFLAGS) -o $(BIN) $(OBJ)
  
  clean:
  rm -f *.o *~ core $(BIN)
  </code></pre>
  
  <p>When I do <code>make</code>, the build fails with the following errors:</p>
  
  <pre><code>gtkled.o: In function `gtk_led_size_allocate':
  gtkled.c:(.text+0x43a): undefined reference to `g_return_if_fail_warning'
  gtkled.c:(.text+0x487): undefined reference to `gdk_window_move_resize'
  gtkled.o: In function `gtk_led_size_request':
  gtkled.c:(.text+0x4f5): undefined reference to `g_return_if_fail_warning'
  </code></pre>
  
  <p>So I don't understand why.... I'm new to Linux, so that's hard for me :)
  (On ubuntu, working with virtualBox)</p>
  
  <p>Thanks.</p>