apt-get install libgtk2.0-dev
orapt-get install libgtk-3-dev
gcc <your_file> `pkg-config --cflags --libs gtk+-2.0`
gcc int.c pkg-config --cflags --libs gtk+-2.0 |
gcc: error: pkg-config: No existe el archivo o el directorio (=file or directory does not exist)
gcc: error: gtk+-2.0: No existe el archivo o el directorio ( " )
gcc: error: unrecognized command line option ‘--cflags’
gcc: error: unrecognized command line option ‘--libs’
Okey, So I got a program called 'int.c' and I typed the next thing:
gcc int.c pkg-config --cflags --libs gtk+-2.0
gcc int.c `pkg-config --cflags --libs gtk+-2.0`
gcc: error: pkg-config --cflags --libs gtk+-2.0: No existe el archivo o el directorio
xires@Synthesium:~/proj/code/c$ pkg-config --version
0.26
xires@Synthesium:~/proj/code/c$ pkg-config --cflags --libs gtk+-3.0
-pthread -I/usr/local/include/libpng16 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/cair
o -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/i
nclude/libpng12 -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0
xires@Synthesium:~/proj/code/c$ cat gtktst.c
#include <gtk/gtk.h>
int main(int argc, char **argv) {
gtk_init(&argc, &argv);
return 0;
}
xires@Synthesium:~/proj/code/c$ gcc -Wall -Wextra -W -ansi -pedantic -o gtktst{,.c} `pkg-config --cflags --libs gtk+-3.0`
xires@Synthesium:~/proj/code/c$ ldd gtktst | grep gtk
libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f8a1e107000)
xires@Synthesium:~/proj/code/c$