Re: Static compilation of hello world




On Fri, Jun 20, 2003 at 11:05:22AM +0200, Patricia Balbastre Betoret wrote:
El Jueves, 19 de Junio de 2003 19:18, Miguel Mendez escribió:
On Thu, 19 Jun 2003 18:20:32 +0200
Patricia Balbastre Betoret <patricia disca upv es> wrote:

Hi,

gcc `pkg-config --libs --cflags gtk+-2.0`  -static -o base-static

Is this exactly what you typed? There's no reference to the c file :-)

gcc `pkg-config --libs --cflags gtk+-2.0`  -static -o base-static \
base-static.c

should do the trick.

Cheers,

Ups ... well, once the little mistake was fixed, more errors appear:

gcc `pkg-config --libs --cflags gtk+-2.0`  -static -o base-static base.c
/tmp/ccwW8hUR.o(.text+0x1c): In function `main':
: undefined reference to `gtk_init'
/tmp/ccwW8hUR.o(.text+0x29): In function `main':
: undefined reference to `gtk_window_new'
/tmp/ccwW8hUR.o(.text+0x3a): In function `main':
: undefined reference to `gtk_widget_show'
/tmp/ccwW8hUR.o(.text+0x42): In function `main':
: undefined reference to `gtk_main'
collect2: ld returned 1 exit status
make: *** [static] Error 1

And I suppose that now this has to be with the static option ... I really do 
not know how to solve it ... Help!!!


I'am not very sure. But `pkg-config --libs --cflags gtk+-2.0` makes
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 
-I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  
-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
in my system.
I think this is a link time error. Maybe --export-dynamic parameter should not
be used here.
But when I removed this parameter, more errors occured.
/usr/bin/ld: cannot find -lgtk-x11-2.0
I was confused.




-- 
Patricia Balbastre Betoret
Departamento de Informatica de Sistemas y Computadores
Camino de Vera, 14, E-46071, Valencia, Spain
Tel: +34 96 387 70 00 Ext 75707
Fax: +34 96 387 75 79
http://ttt.upv.es/~patbalb1
-----------------------------
http://www.fsf.org/philosophy/no-word-attachments.es.html

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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