Compiling Gtk Statically



I have solve some of the errors by adding these parameters to the gcc :

cc -static main.c interface.c callbacks.c support.c -o Test -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome/include/atk-1.0 -I/opt/gnome/include/pango-1.0 -I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include -L/usr/local/lib -L/usr/X11R6/lib -L/opt/gnome/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lXrandr -lXinerama -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lXcursor -lXfixes -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lfontconfig -lfreetype -lXrender -lX11 -lXext -lpng12 -lz -lglitz -lm -lpthread -lexpat -lcom_err -lresolv

Now, here is the rest of the errors, Can anyone help me?

/usr/local/lib/libgmodule-2.0.a(gmodule.o): In function `_g_module_open':
/root/Desktop/glib-2.8.5/gmodule/gmodule-dl.c:98: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/libgtk-x11-2.0.a(gtkfilesystemunix.o): In function `expand_tilde': /root/Desktop/gtk+-2.8.20/gtk/gtkfilesystemunix.c:1027: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
/root/Desktop/glib-2.8.5/glib/gutils.c:1623: warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /root/Desktop/glib-2.8.5/glib/gutils.c:1622: warning: Using 'setpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /root/Desktop/glib-2.8.5/glib/gutils.c:1624: warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/X11R6/lib/libX11.a(GetDflt.o): In function `GetHomeDir':
(.text+0x99): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/lib/libglib-2.0.a(gutils.o): In function `g_get_any_init_do':
/root/Desktop/glib-2.8.5/glib/gutils.c:1581: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/X11R6/lib/libX11.a(x11trans.o): In function `_X11TransSocketOpen':
(.text+0x50c): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/X11R6/lib/libX11.a(x11trans.o): In function `_X11TransSocketUNIXConnect': (.text+0xf1c): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/X11R6/lib/libX11.a(x11trans.o): In function `_X11TransSocketINETConnect': (.text+0x1e1b): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/local/lib/libpangocairo-1.0.a(pangocairo-fcfontmap.o): In function `pango_cairo_fc_font_map_get_type': /root/Desktop/pango-1.10.2/pango-1.10.2/pango/pangocairo-fcfontmap.c:73: undefined reference to `pango_fc_font_map_get_type' /usr/local/lib/libpangocairo-1.0.a(pangocairo-fcfontmap.o): In function `pango_cairo_fc_font_map_set_resolution': /root/Desktop/pango-1.10.2/pango-1.10.2/pango/pangocairo-fcfontmap.c:43: undefined reference to `pango_fc_font_map_cache_clear' /usr/local/lib/libpangocairo-1.0.a(pangocairo-fcfont.o): In function `pango_cairo_fc_font_get_type': /root/Desktop/pango-1.10.2/pango-1.10.2/pango/pangocairo-fcfont.c:147: undefined reference to `pango_fc_font_get_type' /usr/local/lib/libpangocairo-1.0.a(pangocairo-fcfont.o): In function `pango_cairo_fc_font_get_metrics': /root/Desktop/pango-1.10.2/pango-1.10.2/pango/pangocairo-fcfont.c:269: undefined reference to `pango_fc_font_map_create_context' /root/Desktop/pango-1.10.2/pango-1.10.2/pango/pangocairo-fcfont.c:273: undefined reference to `pango_fc_font_create_metrics_for_context'
collect2: ld returned 1 exit status



----- Original Message ----- From: "Alexandre Moreira" <alexandream gmail com>
To: "Baha' Ashour" <bashour infinitetiers com>
Sent: Thursday, January 18, 2007 2:35 PM
Subject: Re: Compiling Gtk Statically


2007/1/18, Alexandre Moreira <alexandream gmail com>:
Baha'Ashour,

If you get to solve your problem outside from this list, please post
it (at least to me) since I want to know about that too.

To the list,
If anyone can answer this, and tell if there is any difference between
the static compiling process we should use for Gtk+ on linux and the
windows, I'd be most grateful, I'm planning on releasing an
application to Linux/Windows in the next months and I'd like to have
the windows version statically linked.

Best Regards,
Alexandre Moreira.


And, is there any legal problem with Gtk+ and static linking ? I've
read someone talking about LGPL libraries and static linking violating
the license, but I don't know if it is true or not.

Thanks,
Alexandre Moreira.

2007/1/18, Baha' Ashour <bashour infinitetiers com>:
>
>
> Hello all,
>
> Can anybody help me in compiling my program statically? i have made > an
> application using Glade, and compiling it in this way:
>         ./configure CC="gcc -static"
>         make
>
> i had got some errors because i don't have the static libraries of the > gtk, > so i had installed the gtk again with --enable-static option, then i > had
> another error says that i should have the atk-static libraries, i had
> installed them. then install pango-static and glib-static.... then i > have
> this error!! WHAT SHOULD I DO!!!!.
>
> /usr/local/lib/libgmodule-2.0.a(gmodule.o): In function > `_g_module_open': > /root/Desktop/glib-2.8.5/gmodule/gmodule-dl.c:98: warning: Using > 'dlopen' in > statically linked applications requires at runtime the shared libraries > from
> the glibc version used for linking
> /usr/local/lib/libgtk-x11-2.0.a(gtkfilesystemunix.o): In function
> `expand_tilde':
> /root/Desktop/gtk+-2.8.20/gtk/gtkfilesystemunix.c:1027: warning: Using
> 'getpwnam' in statically linked applications requires at runtime the > shared
> libraries from the glibc version used for linking
> /usr/local/lib/libglib-2.0.a(gutils.o): In function > `g_get_any_init_do': > /root/Desktop/glib-2.8.5/glib/gutils.c:1623: warning: Using 'getpwuid' > in > statically linked applications requires at runtime the shared libraries > from
> the glibc version used for linking
> /root/Desktop/glib-2.8.5/glib/gutils.c:1622: warning: Using 'setpwent' > in > statically linked applications requires at runtime the shared libraries > from
> the glibc version used for linking
> /root/Desktop/glib-2.8.5/glib/gutils.c:1624: warning: Using 'endpwent' > in > statically linked applications requires at runtime the shared libraries > from
> the glibc version used for linking
> /usr/X11R6/lib/libX11.a(GetDflt.o): In function `GetHomeDir':
> (.text+0x99): warning: Using 'getpwnam_r' in statically linked > applications > requires at runtime the shared libraries from the glibc version used > for
> linking
> /usr/local/lib/libglib-2.0.a(gutils.o): In function > `g_get_any_init_do': > /root/Desktop/glib-2.8.5/glib/gutils.c:1581: warning: Using > 'getpwuid_r' in > statically linked applications requires at runtime the shared libraries > from
> the glibc version used for linking
> /usr/X11R6/lib/libX11.a(x11trans.o): In function `_X11TransSocketOpen':
> (.text+0x50c): warning: Using 'getaddrinfo' in statically linked
> applications requires at runtime the shared libraries from the glibc > version
> used for linking
> /usr/X11R6/lib/libX11.a(x11trans.o): In function
> `_X11TransSocketUNIXConnect':
> (.text+0xf1c): warning: Using 'gethostbyname' in statically linked
> applications requires at runtime the shared libraries from the glibc > version
> used for linking
> /usr/X11R6/lib/libX11.a(x11trans.o): In function
> `_X11TransSocketINETConnect':
> (.text+0x1e1b): warning: Using 'getservbyname' in statically linked
> applications requires at runtime the shared libraries from the glibc > version
> used for linking
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_lock_global_image_glyph_cache':
> (.text+0x2ee): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_scaled_font_map_unlock':
> (.text+0x30e): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_toy_font_face_hash_table_unlock':
> (.text+0x32e): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_toy_font_face_hash_table_lock':
> (.text+0x34e): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_toy_font_face_hash_table_lock':
> (.text+0x37f): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_scaled_font_map_lock':
> (.text+0x4df): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_scaled_font_map_lock':
> (.text+0x541): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_unlock_global_image_glyph_cache':
> (.text+0x6b7): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_font_reset_static_data':
> (.text+0x121b): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_font_reset_static_data':
> (.text+0x12b6): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-font.o):
> In function `_cairo_font_reset_static_data':
> (.text+0x12d9): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-ft-font.o):
> In function `_cairo_ft_unscaled_font_map_unlock':
> (.text+0x114e): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-ft-font.o):
> In function `_cairo_ft_unscaled_font_map_lock':
> (.text+0x116f): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-ft-font.o):
> In function `_cairo_ft_unscaled_font_map_lock':
> (.text+0x11e2): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-ft-font.o):
> In function `_cairo_ft_font_reset_static_data':
> (.text+0x1ea0): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-ft-font.o):
> In function `_cairo_ft_font_reset_static_data':
> (.text+0x1f24): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-surface.o):
> In function `_lock_xlib_glyphset_caches':
> (.text+0x2be): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-surface.o):
> In function `_unlock_xlib_glyphset_caches':
> (.text+0x322): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-screen.o):
> In function `_cairo_xlib_screen_reset_static_data':
> (.text+0xf): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-screen.o):
> In function `_cairo_xlib_screen_reset_static_data':
> (.text+0x42): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-screen.o):
> In function `_cairo_xlib_close_display':
> (.text+0x62): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-screen.o):
> In function `_cairo_xlib_close_display':
> (.text+0x92): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-screen.o):
> In function `_cairo_xlib_screen_info_get':
> (.text+0x1f4): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libcairo.a(cairo-xlib-screen.o):
> In function `_cairo_xlib_screen_info_get':
> (.text+0x398): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `FcFreeTypeUseNames':
> (.text+0x14a): undefined reference to `FT_Has_PS_Glyph_Names'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L431':
> (.text+0x2335): undefined reference to `FT_Get_PS_Font_Info'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L431':
> (.text+0x24d7): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L431':
> (.text+0x2510): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L431':
> (.text+0x2768): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L431':
> (.text+0x2793): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L431':
> (.text+0x27b7): undefined reference to `FT_Get_X11_Font_Format'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L431':
> (.text+0x281c): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L596':
> (.text+0x2848): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L596':
> (.text+0x2947): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L596':
> (.text+0x2b31): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcfreetype.o):
> In function `.L602':
> (.text+0x2f73): undefined reference to `FT_Get_BDF_Property'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigMessage':
> (.text+0x25b): undefined reference to `XML_GetCurrentLineNumber'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigMessage':
> (.text+0x2e9): undefined reference to `XML_GetCurrentLineNumber'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x1fe3): undefined reference to `XML_ParserCreate'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x2032): undefined reference to `XML_SetUserData'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x2051): undefined reference to `XML_SetDoctypeDeclHandler'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x2070): undefined reference to `XML_SetElementHandler'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x2085): undefined reference to `XML_SetCharacterDataHandler'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x209f): undefined reference to `XML_GetBuffer'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x20e2): undefined reference to `XML_ParseBuffer'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x210c): undefined reference to `XML_ParserFree'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x2429): undefined reference to `XML_GetErrorCode'
> /usr/lib/gcc/i586-suse-linux/4.1.0/../../../libfontconfig.a(fcxml.o):
> In function `FcConfigParseAndLoad':
> (.text+0x2431): undefined reference to `XML_ErrorString'
> /usr/X11R6/lib/libX11.a(XlibInt.o): In function
> `_XProcessInternalConnection':
> (.text+0x1883): undefined reference to `pthread_equal'
> /usr/X11R6/lib/libX11.a(XlibInt.o): In function `_XReadEvents':
> (.text+0x2ec4): undefined reference to `pthread_equal'
> /usr/X11R6/lib/libX11.a(XlibInt.o): In function `_XReadEvents':
> (.text+0x2eeb): undefined reference to `pthread_equal'
> /usr/X11R6/lib/libX11.a(XlibInt.o): In function `_XReadEvents':
> (.text+0x2f01): undefined reference to `pthread_equal'
> /usr/X11R6/lib/libX11.a(XlibInt.o): In function `_XReadEvents':
> (.text+0x2f48): undefined reference to `pthread_equal'
> /usr/X11R6/lib/libX11.a(XlibInt.o):(.text+0x3038): more undefined > references
> to `pthread_equal' follow
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `__deregister_frame_info_bases':
> (.text+0x104e): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `__deregister_frame_info_bases':
> (.text+0x105e): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `__register_frame_info_table_bases':
> (.text+0x115a): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `__register_frame_info_table_bases':
> (.text+0x1171): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `__register_frame_info_bases':
> (.text+0x126c): undefined reference to `pthread_mutex_lock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `__register_frame_info_bases':
> (.text+0x1283): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `_Unwind_Find_FDE':
> (.text+0x14df): undefined reference to `pthread_mutex_unlock'
> /usr/lib/gcc/i586-suse-linux/4.1.0/libgcc_eh.a(unwind-dw2-fde-glibc.o):
> In function `_Unwind_Find_FDE':
> (.text+0x14f2): undefined reference to `pthread_mutex_lock'
> collect2: ld returned 1 exit status
> make: *** [test1] Error 1
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
>
>







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