Skip to main content

Thread: Linking Problem while Compiling glib


this thread marked solved solved compiling different version of glib

i'm trying compile glib-2.34.2 mingw. have had fix 2 or 3 compile errors faced linking problem can't figure out.

here configure options supplied , output of error:
code:
$ ../configure --prefix=/mingw --disable-shared --enable-static --disable-libelf cflags=-static-libgcc -march=i486 cxxflags=-static-libgcc -march=i486 pkg_config_path=/c/development/libraries/gtk-3.7.0/lib/pkgconfig ldflags=-l/c/development/libraries/gtk-3.7.0/lib cppflags=-i/c/development/libraries/gtk-3.7.0/include
code:
....   cc       glib-compile-resources.o   ccld     glib-compile-resources.exe   cc       gsettings-tool.o   ccld     gsettings.exe   cc       gdbus-tool.o   ccld     gdbus.exe ./.libs/libgio-2.0.a(libgio_2_0_la-gdbusaddress.o):gdbusaddress.c:(.text+0x1d9a): undefined referen   ce `_g_io_win32_get_module' collect2.exe: error: ld returned 1 exit status make[4]: *** [gdbus.exe] error 1 ....
the problem appears in area of gio/gdbusaddress.c:
php code:
....
  if (
address == null)
    {
      
gio_path[max_path] = 0;
      if (
getmodulefilenamew (_g_io_win32_get_module (), gio_pathmax_path))
    {
      
process_information pi = { };
      
startupinfow si = { };
      
bool res;
      
wchar_t gio_path_short[max_path];
      
wchar_t rundll_path[max_path*2];
      
wchar_t args[max_path*4];
.... 
here lines think problem in makefile:
php code:
....
gdbus_ldadd libgio-2.0.la \
    $(
top_builddir)/glib/libglib-2.0.la         \
    $(
top_builddir)/gobject/libgobject-2.0.la
....

....
gdbus$(exeext): $(gdbus_objects) $(gdbus_dependencies) $(extra_gdbus_dependencies
    @
rm -f gdbus$(exeext)
    $(
am_v_ccld)$(link) $(gdbus_objects) $(gdbus_ldadd) $(libs)
.... 
i don't know if i'm correct sounds gdbus.exe not being linked object file contains _g_io_win32_get_module.

----- edit -----

problem occurs when building in gio sub-directory. have noted none of executable produced far work.

----- edit -----

i've decided try , compile development version, 2.35.1, well. i've run on couple of small problems executables produced seem working. once again, of problems seem in "gio" directory.

----- solved -----

hoorah! able compile shared version of 2.35.1. i'm going try static version , post fixes came across.

----- edit -----

well, static builds don't seem work on machine. here patch created. not solve of issues faced:

code:
diff -rupn glib-2.35.1/gio/gthreadedresolver.c glib-2.35.1-new/gio/gthreadedresolver.c --- glib-2.35.1/gio/gthreadedresolver.c	2012-10-16 09:40:06 -0700 +++ glib-2.35.1-new/gio/gthreadedresolver.c	2012-11-14 23:59:14 -0800 @@ -204,12 +204,12 @@ do_lookup_records (gtask         *task,  {    lookuprecordsdata *lrd = task_data;    glist *targets; +  gerror *error = null;  #if defined(g_os_unix)    gint len = 512;    gint herr;    gbytearray *answer;    gint rrtype; -  gerror *error = null;      rrtype = _g_resolver_record_type_to_rrtype (lrd->record_type);    answer = g_byte_array_new (); diff -rupn glib-2.35.1/gio/gunixmounts.h glib-2.35.1-new/gio/gunixmounts.h --- glib-2.35.1/gio/gunixmounts.h	2012-10-13 08:01:55 -0700 +++ glib-2.35.1-new/gio/gunixmounts.h	2012-11-14 22:45:11 -0800 @@ -78,7 +78,7 @@ gint           g_unix_mount_point_compar  const char *   g_unix_mount_point_get_mount_path    (gunixmountpoint    *mount_point);  const char *   g_unix_mount_point_get_device_path   (gunixmountpoint    *mount_point);  const char *   g_unix_mount_point_get_fs_type       (gunixmountpoint    *mount_point); -glib_available_in_2_32 +glib_available_in_2_32;  const char *   g_unix_mount_point_get_options       (gunixmountpoint    *mount_point);  gboolean       g_unix_mount_point_is_readonly       (gunixmountpoint    *mount_point);  gboolean       g_unix_mount_point_is_user_mountable (gunixmountpoint    *mount_point); diff -rupn glib-2.35.1/gio/tests/makefile.in glib-2.35.1-new/gio/tests/makefile.in --- glib-2.35.1/gio/tests/makefile.in	2012-10-22 13:19:39 -0700 +++ glib-2.35.1-new/gio/tests/makefile.in	2012-11-15 00:44:27 -0800 @@ -1011,7 +1011,7 @@ pyexecdir = @pyexecdir@  pythondir = @pythondir@  sbindir = @sbindir@  sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ +srcdir = @srcdir@/  sysconfdir = @sysconfdir@  target_alias = @target_alias@  top_build_prefix = @top_build_prefix@
another problem had in gio/makefile. had change line:
code:
zlib_libs = -l -lz
to:
code:
zlib_libs = -lz
before compile. have version of libtool installed.

got following error:
code:
no rule make target `../../../gio/tests\test1.txt', needed `test_resources.c'.
i fixed changing line in gio/tests/makefile from:
code:
srcdir = ../../../gio/tests
to:
code:
srcdir = ../../../gio/tests/



Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Packaging and Compiling Programs [SOLVED] Linking Problem while Compiling glib


Ubuntu

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?