Re: how to remove deprecated widgets - downsizing GTK



   Hi there,

On 3/7/06, Durai <durai ingenient com> wrote:
> I tried compiling the gtk libraries statically. But and linked my apps
> to the static library. But I have another problem now, the statically
> compiled gtk libraries are not able to load the pixbuf theme engines.

   I believe this is due to the fact that (most) theme engines have,
in fact, shared libraries. You need to link libdl (and libc)
dynamically into your application for dynamic loading of libraries to
suceed. My suggestion would be to link GTK+ statically, and libdl/libc
dynamically, such as in the (crude) example below:

[rodarvus wakko ~]$ gcc -o foo `pkg-config --cflags gtk+-2.0` foo.c
-Wl,-Bstatic \
    `pkg-config --libs gtk+-2.0 | sed s/\ -ldl//` -Wl,-Bdynamic -ldl

[rodarvus wakko ~]$ ldd foo
        linux-gate.so.1 =>  (0xffffe000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7f7f000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7e51000)
        /lib/ld-linux.so.2 (0xb7fa9000)
[rodarvus wakko ~]$

   The example above assumes gcc+binutils, but most modern linkers
accept this kind of construction.

   Hope it helps,

   Rodrigo



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