I'm trying to compile and link a simple program downloaded from the web to learn how to make a GUI using the gtk+
library.
Here is my makefile:
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)
When I do make
, the build fails with the following errors:
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'
So I don't understand why.... I'm new to Linux, so that's hard for me :) (On ubuntu, working with virtualBox)
Thanks.