So many warnning when I compiled base.c ?



I wrote a Makefile for base.c, like following:
+----------------------------------------------------------
|# Makefile
|
|CFLAGS+=`pkg-config --cflags --libs gtk+-2.0`
|
|base:base.o
| $(CC) $< -o $@ $(CFLAGS)
+----------------------------------------------------------

But when I run "make", there were many warnning information like below came out:
+----------------------------------------------------------
| gcc `pkg-config --cflags --libs gtk+-2.0`   -c -o base.o base.c
| gcc: -lgtk-x11-2.0: linker input file unused because linking not done
| gcc: -lgdk-x11-2.0: linker input file unused because linking not done
| gcc: -latk-1.0: linker input file unused because linking not done
| gcc: -lgdk_pixbuf-2.0: linker input file unused because linking not done
| gcc: -lm: linker input file unused because linking not done
| gcc: -lpangocairo-1.0: linker input file unused because linking not done
| gcc: -lpango-1.0: linker input file unused because linking not done
| gcc: -lcairo: linker input file unused because linking not done
| gcc: -lgobject-2.0: linker input file unused because linking not done
| gcc: -lgmodule-2.0: linker input file unused because linking not done
| gcc: -ldl: linker input file unused because linking not done
| gcc: -lglib-2.0: linker input file unused because linking not done
| gcc base.o -o base `pkg-config --cflags --libs gtk+-2.0`
+----------------------------------------------------------

I know "gcc -c" make this happen, but how to change Makefile to fix it?
What the Makefile should be commonly?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]