GTK+ compilation undefined reference C
问题 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