How to compile program with gtk+-3.0?

I am using GTK+-3.0 in ubuntu 12.04. I am trying to compile program but every time fail

apple@ubuntu:~/Downloads$ gcc -Wall -g gtktest.c $(pkg-config --libs --cflags gtk+-3.0) -o gtktest

gtktest.c: In function ‘main’:
gtktest.c:21:3: warning: implicit declaration of function ‘gtk_signal_connect’ [-Wimplicit-function-declaration]
gtktest.c:21:3: warning: implicit declaration of function ‘GTK_OBJECT’ [-Wimplicit-function-declaration]
gtktest.c:21:3: warning: implicit declaration of function ‘GTK_SIGNAL_FUNC’ [-Wimplicit-function-declaration]
gtktest.c:22:3: warning: implicit declaration of function ‘gtk_container_border_width’ [-Wimplicit-function-declaration]
gtktest.c:28:3: warning: implicit declaration of function ‘gtk_signal_connect_object’ [-Wimplicit-function-declaration]
/tmp/ccH48jvQ.o: In function `main':
/home/apple/Downloads/gtktest.c:21: undefined reference to `GTK_SIGNAL_FUNC'
/home/apple/Downloads/gtktest.c:21: undefined reference to `GTK_OBJECT'
/home/apple/Downloads/gtktest.c:21: undefined reference to `gtk_signal_connect'
/home/apple/Downloads/gtktest.c:22: undefined reference to `gtk_container_border_width'
/home/apple/Downloads/gtktest.c:26: undefined reference to `GTK_SIGNAL_FUNC'
/home/apple/Downloads/gtktest.c:26: undefined reference to `GTK_OBJECT'
/home/apple/Downloads/gtktest.c:26: undefined reference to `gtk_signal_connect'
/home/apple/Downloads/gtktest.c:28: undefined reference to `GTK_OBJECT'
/home/apple/Downloads/gtktest.c:28: undefined reference to `GTK_SIGNAL_FUNC'
/home/apple/Downloads/gtktest.c:28: undefined reference to `GTK_OBJECT'
/home/apple/Downloads/gtktest.c:28: undefined reference to `gtk_signal_connect_object'
/usr/local/lib/libcairo.so: undefined reference to `pixman_glyph_cache_lookup'
/usr/local/lib/libcairo.so: undefined reference to `pixman_glyph_cache_insert'
/usr/local/lib/libcairo.so: undefined reference to `pixman_composite_glyphs'
/usr/local/lib/libcairo.so: undefined reference to `pixman_glyph_cache_remove'
/usr/local/lib/libcairo.so: undefined reference to `pixman_glyph_get_mask_format'
/usr/local/lib/libcairo.so: undefined reference to `pixman_composite_glyphs_no_mask'
/usr/local/lib/libcairo.so: undefined reference to `pixman_glyph_cache_thaw'
/usr/local/lib/libcairo.so: undefined reference to `pixman_glyph_cache_freeze'
/usr/local/lib/libcairo.so: undefined reference to `pixman_glyph_cache_create'
collect2: ld returned 1 exit status

With another command.

apple@ubuntu:~/Downloads$ gcc -Wall -g gtktest.c $(pkg-config --libs --cflags glib-2.0) -o gtktest
        In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30:0,
                         from /usr/include/gtk-3.0/gdk/gdk.h:32,
                         from /usr/local/include/gtk-3.0/gtk/gtk.h:32,
                         from gtktest.c:1:
        /usr/include/gtk-3.0/gdk/gdktypes.h:37:19: fatal error: cairo.h: No such file or directory
        compilation terminated.

Any one how to solve this problem i am trying to solve this problem for last 4 days. Please someone can give me proper solution?


Source: ubuntu

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.