c - How to setup an Autoconf project to make with GTK? -
how setup autoconf project utilize gtk? there 1 source file (main.c). created necessary files autoconf, , when type "make" can't find gtk include "gtk/gtk.h".
// create error
make[2]: entering directory `/home/anon/projects/firstgtkprog/src' gcc -dhave_config_h -i. -i.. -g -o2 -mt main.o -md -mp -mf .deps/main.tpo -c -o main.o main.c main.c:1:21: fatal error: gtk/gtk.h: no such file or directory compilation terminated.
// configure.ac file contents
ac_init([firstgtkprog], [1.0], [bug-developer@foda.com])
am_init_automake([-wall -werror foreign])
ac_prog_cc
ac_config_headers([config.h])
ac_config_files([ makefile src/makefile ])
ac_output
gtk+ uses pkg-config
utility provide necessary compiler , library flags development tools build programs library. example, pkg-config --cflags gtk+-3.0
prints out flags compile gtk, , pkg-config --libs gtk+-3.0
prints out libs.
to integrate autoconf build system, need utilize pkg_check_modules
macro. this tutorial explains in details.
c gcc gtk configure autoconf
No comments:
Post a Comment