Hey,

My gcc linking command:
gcc -o bin/target  <all .o files> -static -Wl --rpath
/opt/lib/directfb-1.2-0/wm/libdirectfbwm_default.o
/opt/lib/directfb-1.2-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o
-lpng -lz -lm 
/opt/lib/directfb-1.2-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.o
/opt/lib/directfb-1.2-0/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_gif.o
/opt/lib/directfb-1.2-0/inputdrivers/libdirectfb_linux_input.o
/opt/lib/directfb-1.2-0/gfxdrivers/libdirectfb_i810.o
/opt/lib/directfb-1.2-0/systems/libdirectfb_fbdev.o -L/opt/lib
-lgtk-directfb-2.0 -lgdk-directfb-2.0 -latk-1.0 -lgdk_pixbuf-2.0
-lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0
-lgmodule-2.0 -lglib-2.0 -liconv -lfontconfig -lfreetype -lexpat
-ldirectfb -lpng12 -lz -lm -lpixman-1 -lfusion -ldirect -lpthread -ldl

This compiled!  Boyah!  But didn't run....

I got these warnings (not important but I would like to get rid of
these, if possible):
/opt/lib/libgmodule-2.0.a(gmodule.o): In function `_g_module_open':
/root/Libs/glib-2.16.3/gmodule/gmodule-dl.c:99: warning: Using
'dlopen' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking
/opt/lib/libfusion.a(conf.o): In function `fusion_config_set':
conf.c:(.text+0x79): warning: Using 'getgrnam' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
/opt/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
/root/Libs/glib-2.16.3/glib/gutils.c:1653: warning: Using 'getpwuid'
in statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
/root/Libs/glib-2.16.3/glib/gutils.c:1652: warning: Using 'setpwent'
in statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
/root/Libs/glib-2.16.3/glib/gutils.c:1654: warning: Using 'endpwent'
in statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
/root/Libs/glib-2.16.3/glib/gutils.c:1596: warning: Using 'getpwnam_r'
in statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
/root/Libs/glib-2.16.3/glib/gutils.c:1602: warning: Using 'getpwuid_r'
in statically linked applications requires at runtime the shared
libraries from the glibc version used for linking
/opt/lib/libdirect.a(log.o): In function `parse_host_addr':
log.c:(.text+0x265): warning: Using 'getaddrinfo' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking


The code that's causing a problem:
    GdkPixbuf *                   p;
    gui_main_bg_name                      = "pixmaps/gui_main.gif";
    if ((p = gdk_pixbuf_new_from_file (gui_main_bg_name, NULL)) == NULL)
    {
        gchar ch[64];
        sprintf (ch, "pixbuf new from file %s", gui_main_bg_name);
        gui_main_exit (__func__, ch);
    }

The "gdk_pixbuf_new_from_file" is returned as NULL...

Before I started down this path I could compile and run when linked
dynamically, but not statically - now neither static nor dynamic will
load the .gif file.

Anyone know what's going on here?



-- supporting story of how I arrived here: --

I was struggling to get my DFB/GTK app statically compiled (for an
embedded application) and I think it has to do with the ordering of
the -lLIB options to gcc.  This made me think I might be compiling my
libraries in the wrong order as well...

$PREFIX=/opt (incase anyone cares)
$STATIC=--enable-static

Here's the order for compiling:
PKGCONFIG
        ./configure $PREFIX $STATIC --without-x
GETTEXT
        ./configure $PREFIX $STATIC --enable-relocatable --disable-java
--disable-native-java --disable-openmp --without-emacs
ZLIB
        ./configure $PREFIX $STATIC
LIBPNG
        (Libpng comes with a Makefile who's prefix= line was modified.)
LIBICONV
        ./configure $PREFIX $STATIC --enable-relocatable
EXPAT
        ./configure $PREFIX $STATIC --without-x --disable-xlib --disable-win32
FREETYPE
        ./configure $PREFIX $STATIC --without-x --without-quickdraw-toolbox
--without-quickdraw-carbon --enable-directfb --disable-xlib
--disable-win32
FONTCONFIG
        ./configure $PREFIX $STATIC --without-x --enable-directfb
--disable-xlib --disable-win32 --disable-docs --disable-libxml2
--with-expat-includes=$TARGET/include --with-expat-lib=$TARGET/lib
GETTEXT
        ./configure $PREFIX $STATIC --enable-relocatable --disable-java
--disable-native-java --disable-openmp --without-emacs
        (gettext recompiled for circular dependency on libiconv)
GLIB
        ./configure $PREFIX $STATIC --disable-selinux --with-libiconv=gnu
--disable-gtk-doc --disable-man --disable-debug --disable-mem-pools
DIRECTFB
        ./configure $PREFIX $STATIC --with-inputdrivers=linuxinput
--with-gfxdrivers=i810 --disable-osx --enable-fbdev --disable-vnc
--disable-jpeg --enable-zlib --enable-png --disable-video4linux
EXPAT
        ./configure $PREFIX $STATIC --without-x --enable-directfb
--disable-xlib --disable-win32
        (expat recompiled with directfb support, but after fontconfig which
comes before directfb)
PIXMAN
        ./configure $PREFIX $STATIC
CAIRO
        ./configure $PREFIX $STATIC --enable-directfb=yes --disable-xlib
--disable-xlib-xrender --disable-xcb --enable-png --disable-svg
--without-x --disable-win32
PANGO
        ./configure $PREFIX $STATIC --disable-debug
--with-included-modules=yes --enable-cairo --without-x --disable-xlib
--disable-win32 --disable-gtk-doc --disable-man
ATK
        ./configure $PREFIX $STATIC --disable-gtk-doc
GTK
        ./configure $PREFIX $STATIC --with-gdktarget=directfb --without-x
--with-libpng --without-libjpeg --without-libtiff --disable-gtk-doc
--disable-man --disable-shadowfb --disable-modules
--with-included-loaders=png --disable-debug


Using pkg-config (pkg-config --static --libs gtk+-directfb-2.0)
results in the following library ordering:
gcc  -o bin/target  <all .o files> -static -Wl --rpath -L/opt/lib
-lgtk-directfb-2.0 -lgdk-directfb-2.0 -latk-1.0 -lgdk_pixbuf-2.0
-lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0
-lgmodule-2.0 -lglib-2.0 -liconv -lfreetype -lfontconfig -lexpat
-ldirectfb -lpng12 -lz -lm -lpixman-1 -lfusion -ldirect -lpthread -ldl

I got a whole bunch of warnings and then a bunch of messages about FontConfig:
/opt/lib/libfontconfig.a(fcfreetype.o): In function `FcFreeTypeUseNames':
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:2334: undefined
reference to `FT_Has_PS_Glyph_Names'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:2334: undefined
reference to `FT_Has_PS_Glyph_Names'
/opt/lib/libfontconfig.a(fcfreetype.o): In function `IA__FcFreeTypeQueryFace':
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1495: undefined
reference to `FT_Get_PS_Font_Info'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1530: undefined
reference to `FT_Get_BDF_Property'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1649: undefined
reference to `FT_Get_BDF_Property'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1670: undefined
reference to `FT_Get_BDF_Property'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1537: undefined
reference to `FT_Get_BDF_Property'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1559: undefined
reference to `FT_Get_BDF_Property'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1743: undefined
reference to `FT_Get_X11_Font_Format'
/opt/lib/libfontconfig.a(fcfreetype.o): In function `FcGetPixelSize':
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1059: undefined
reference to `FT_Get_BDF_Property'
/opt/lib/libfontconfig.a(fcfreetype.o): In function `IA__FcFreeTypeQueryFace':
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1708: undefined
reference to `FT_Get_BDF_Property'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1712: undefined
reference to `FT_Get_BDF_Property'
/root/Libs/fontconfig-2.4.91/src/fcfreetype.c:1722: undefined
reference to `FT_Get_BDF_Property'


After reading this:
http://lists.trolltech.com/qt-interest/2006-03/thread01688-0.html, I
switched freetype and fontconfig:
gcc  -o bin/target  <all .o files> -static -Wl --rpath -L/opt/lib
-lgtk-directfb-2.0 -lgdk-directfb-2.0 -latk-1.0 -lgdk_pixbuf-2.0
-lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0
-lgmodule-2.0 -lglib-2.0 -liconv  -lfontconfig -lfreetype -lexpat
-ldirectfb -lpng12 -lz -lm -lpixman-1 -lfusion -ldirect -lpthread -ldl

This compiled!  Boyah!  But didn't run!
It seemed to be getting stuck against the runtime-usage of the
directfb libraries.

Here's where directfb-config came in handy instead of pkg-config...
selecting my imageprovider, input ,video, etc...
# /opt/bin/directfb-config --libs --input=linux_input --system=fbdev
--graphics=i810 --imageprovider=png,gif --videoprovider=gif
-static
/opt/lib/directfb-1.2-0/wm/libdirectfbwm_default.o
/opt/lib/directfb-1.2-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.o
-lpng -lz -lm 
/opt/lib/directfb-1.2-0/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.o
/opt/lib/directfb-1.2-0/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_gif.o
/opt/lib/directfb-1.2-0/inputdrivers/libdirectfb_linux_input.o
/opt/lib/directfb-1.2-0/gfxdrivers/libdirectfb_i810.o
/opt/lib/directfb-1.2-0/systems/libdirectfb_fbdev.o
-L/opt/lib -ldirectfb -lfusion -ldirect -lpthread -ldl -lz

And when I finished injecting this back into my linking command, I got
the command you see at the top of this posting.

For the life of me, I have no idea what's going-on.  Anyone have any
clues/suggestions?

Thanks,
   Azilat
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to