From: JonY <10...@gm...> - 2009-07-13 11:59:27
|
On 7/13/2009 19:22, Patrick Hanevold wrote: > Hello there, > > I have a linking issue that seems quite specific to mingw, and I have a hard > time figuring out quite what is wrong with it. > > When I try the following to link with my mingw compiled glib-2.0 I get some > undefined references to glib. > > However, a strace as seen further below I can see that it opens up the > correct arcieve for linking. (/usr/i686-mingw32/lib/libglib-2.0.dll.a) > > And when I decompress that arcieve and search through all the object files I > find the functions supposedly missing. > A object dump of d000921.o that contains g_strdup_printf is attached at the > bottom here, and it is in the symbol list. > > Any sugestions? > > /i686-mingw32/include/glib-2.0 -I/usr/i686-mingw32/lib/glib-2.0/include > -L/usr/i686-mingw32/lib -lglib-2.0 xpidl.o xpidl_idl.o xpidl_util.o > xpidl_header.o xpidl_typelib.o xpidl_doc.o xpidl_java.o ./module.res > -L../../../dist/bin -L../../../dist/lib ../../../dist/lib/libxpt.a -lm > -lgdi32 -lwinmm -lwsock32 > xpidl_idl.o:xpidl_idl.c:(.text+0x86): undefined reference to > `_g_strdup_printf' > xpidl_idl.o:xpidl_idl.c:(.text+0xa4): undefined reference to `_g_free' > xpidl_idl.o:xpidl_idl.c:(.text+0xd3): undefined reference to > `_g_strdup_vprintf' > xpidl_idl.o:xpidl_idl.c:(.text+0x110): undefined reference to `_g_free' > xpidl_idl.o:xpidl_idl.c:(.text+0x166): undefined reference to `_g_str_equal' > xpidl_idl.o:xpidl_idl.c:(.text+0x16d): undefined reference to `_g_str_hash' > xpidl_idl.o:xpidl_idl.c:(.text+0x172): undefined reference to > `_g_hash_table_new' > xpidl_idl.o:xpidl_idl.c:(.text+0x210): undefined reference to > `_g_hash_table_insert' > Hi, the -lfoo libs should always be behind your object files. The correct syntax should look like: /i686-mingw32/include/glib-2.0 -I/usr/i686-mingw32/lib/glib-2.0/include -L/usr/i686-mingw32/lib xpidl.o xpidl_idl.o xpidl_util.o xpidl_header.o xpidl_typelib.o xpidl_doc.o xpidl_java.o ./module.res -L../../../dist/bin -L../../../dist/lib ../../../dist/lib/libxpt.a -lglib-2.0 -lm -lgdi32 -lwinmm -lwsock32 |