autoconf-generated Makefile does not pass flags for library headers when using PKG_CHECK_MODULES
问题 My project depends upon a library (more precisely, GTK+) so I added the following configurations in my configure.ac : PKG_CHECK_MODULES([GTK], [gtk+-2.0]) AC_SUBST([GTK_CFLAGS]) AC_SUBST([GTK_LIBS]) My Makefile.am is: bin_PROGRAMS = secretary secretary_SOURCES = secretary.c For its turn, my secretary.c is as follows: #include <gtk/gtk.h> int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show(window); gtk_main();