Statically linked gtk application



Hello

I would like to link statically my simple application:

#include <gtk/gtk.h>

int main(int argc, char *argv){
        gtk_init(&argc,&argv);
        return 0;
}


I try to do this:
plachnina plachninka:~/src$ gcc -static -Wall
`pkg-config --cflags --libs gtk+-2.0` gtk.c

/tmp/cc1rfk9e.o(.text+0x1e): In function `main':
: undefined reference to `gtk_init'
collect2: ld returned 1 exit status


The content of `pkg-config  --libs gtk+-2.0` is following:
plachnina plachninka:~/src$ pkg-config --libs gtk+-2.0

-Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0


All above libraries in static version (with *.a extension) are in
/usr/lib directory (i.e. /usr/lib/libgtk-x11-2.0.a)

Any hint?


-- 
regards
Mariusz Bozewicz



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