Re: [gtk-list] Re: static link w/gtk



Matt Rosencrantz wrote:
[snip]
> I actually did read the man page and so I tried as you suggested:
> gcc  -static -lgtk -lgdk -lglib -lX11 -lXext -lm -o twiz twiz.o interface.o
> io.o
> 
> (*.o had already been built with gcc -c ...)
> 
> unfortunately I just get a big list of undefined symbols(see below). I do
> have the *.a files, they are in the same place as the .so files, and my
> program builds find w/o the static option.  the *.a files were built when I
> installed gtk+... do I need to do something else?
> 
[snip]

try

gcc -static -o twiz twiz.o interface.o io.o -lglib -lgdk -lgtk -lX11 -lXext -lm

ld can be picky about the order of linking.

Tom



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