linking to libgirepository_internals.a



Hi there,

Trying to add tests to the gobject-introspection test suite to cover more of the functions and learn about the code. wanted to create a simple test to create an object from the libgirepository_internals.a but having problems linking, wondering if anyone can give me some advice on this ?

code is here, https://github.com/h4ck3rm1k3/gobject-introspection it is a simple branch of the master git://git.gnome.org/gobject-introspection adding some tests.

The project page for GObjectIntrospection is http://live.gnome.org/GObjectIntrospection

The test module that is not linking is : https://github.com/h4ck3rm1k3/gobject-introspection/blob/master/tests/repository/gitestenum.c

All I did was add in the extra lib :


$(top_builddir)/libgirepository-internals.la
gitestenum_SOURCES = $(srcdir)/gitestenum.c
gitestenum_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
gitestenum_LDADD = $(top_builddir)/libgirepository-1.0.la $(top_builddir)/libgirepository-internals.la $(top_builddir)/libgirepository-gthash.la $(GIREPO_LIBS)

here is the compiler errors:


CCLD   gitestenum
../../.libs/libgirepository-internals.a(libgirepository_internals_la-girnode.o): In         function `_g_ir_node_get_full_size_internal':
gobject-introspection/girepository/girnode.c:629: undefined reference to         `g_type_tag_to_string'
../../.libs/libgirepository-internals.a(libgirepository_internals_la-girnode.o): In function `serialize_type':
gobject-introspection/girepository/girnode.c:1198: undefined reference to `g_type_tag_to_string'
../../.libs/libgirepository-internals.a(libgirepository_internals_la-girmodule.o):         In function `_g_ir_module_build_typelib':
gobject-introspection/girepository/girmodule.c:548: undefined reference to         `g_typelib_new_from_memory'
../../.libs/libgirepository-internals.a(libgirepository_internals_la-giroffsets.o):         In function `get_type_size_alignment':
gobject-introspection/girepository/giroffsets.c:300: undefined reference to         `gi_type_tag_get_ffi_type'
../../.libs/libgirepository-internals.a(libgirepository_internals_la-giroffsets.o): In function `get_enum_size_alignment':
gobject-introspection/girepository/giroffsets.c:174: undefined reference to `g_type_tag_to_string'
../../.libs/libgirepository-internals.a(libgirepository_internals_la-giroffsets.o):         In function `get_type_size_alignment':
gobject-introspection/girepository/giroffsets.c:311: undefined reference to `g_type_tag_to_string'

What is bothering me is that the symbols are there :


gobject-introspection/.libs$ nm libgirepository-1.0.so | grep g_type_tag_to_string
    0000f0c0 T g_type_tag_to_string

gobject-introspection/.libs$ nm libgirepository-1.0.a | grep g_type_tag_to_string
    U g_type_tag_to_string
    00001e00 T g_type_tag_to_string
             U g_type_tag_to_string

And here is the internal linker command /usr/lib/gcc/i686-linux-gnu/4.6.1/collect2 --build-id --no-add-needed --as-needed --eh-frame-hdr -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -z relro -o .libs/gitestenum /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/crt1.o /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i686-linux-gnu/4.6.1/crtbegin.o -L/usr/lib/gcc/i686-linux-gnu/4.6.1 -L/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.6.1/../../.. gitestenum-gitestenum.o --export-dynamic ../../.libs/libgirepository-1.0.so ../../.libs/libgirepository-internals.a -lm -ldl /usr/lib/i386-linux-gnu/libgio-2.0.so /usr/lib/i386-linux-gnu/libgmodule-2.0.so -lffi /usr/lib/i386-linux-gnu/libgobject-2.0.so /usr/lib/i386-linux-gnu/libgthread-2.0.so -lrt /usr/lib/i386-linux-gnu/libglib-2.0.so -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i686-linux-gnu/4.6.1/crtend.o /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/crtn.o

thanks, mike


PS : 

This message was posted to the Mailing list: gtk-devel-list gnome org but was awaiting moderation, maybe it was that I subscribed with @gmail not @googlemail. 

So I had posted it to http://stackoverflow.com/questions/9756571/gobjectintrospection-linking-to-libgirepository-internals-and-libgirepository-1 for asking help, now I have resubscribed to the list with the email matching my sender name. 



--
James Michael DuPont
Member of Free Libre Open Source Software Kosova http://flossk.org


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