From: Patrick H. <pat...@gm...> - 2009-07-13 12:01:40
|
The complete command line should have been: i686-mingw32-gcc -mno-cygwin -o xpidl.exe -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -Wno-long-long -fno-strict-aliasing -mms-bitfields -pipe -DNDEBUG -DTRIMMED -O -I/usr/include/libIDL-2.0 -I/usr/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 2>&1 I also found out that linking directly with d000921.o from libglib-2.0.dll.a makes the undefined reference to g_strdup_printf go away. So does mingw have a issue with linking to archieve files in some way? That -lglib-2.0 sure doesnt link with the objects in the arcieve file it opens. A error message could be of use in this case! The achieve decompress just fine with "i686-mingw32-ar x" so I cant really imagine that the archieve is broken in some way. In fact thats how I extracted d000921.o that liknks just fine. Am I missing something here? Should I link/archieve glib in some other way or something? I really dont have at hand how its done, as Ive just compiled glib as provided, In I would sort of expect the glib package to support mingw just fine. It is designed to support mingw and gives no errors. And the archieve looks just fine to me as I know gcc. On Mon, Jul 13, 2009 at 1:22 PM, Patrick Hanevold < pat...@gm...> 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' > > > [pid 13244] open("/usr/i686-mingw32/lib/libglib-2.0.dll.a", > O_RDONLY|O_LARGEFILE) = 6 > > > d000921.o: file format pe-i386 > d000921.o > architecture: i386, flags 0x00000039: > HAS_RELOC, HAS_DEBUG, HAS_SYMS, HAS_LOCALS > start address 0x00000000 > > Characteristics 0x104 > line numbers stripped > 32 bit words > > Time/Date Thu Jan 1 01:00:00 1970 > Magic 0000 > MajorLinkerVersion 0 > MinorLinkerVersion 0 > SizeOfCode 00000000 > SizeOfInitializedData 00000000 > SizeOfUninitializedData 00000000 > AddressOfEntryPoint 0000000000000000 > BaseOfCode 0000000000000000 > BaseOfData 0000000000000000 > ImageBase 0000000000000000 > SectionAlignment 0000000000000000 > FileAlignment 0000000000000000 > MajorOSystemVersion 0 > MinorOSystemVersion 0 > MajorImageVersion 0 > MinorImageVersion 0 > MajorSubsystemVersion 0 > MinorSubsystemVersion 0 > Win32Version 00000000 > SizeOfImage 00000000 > SizeOfHeaders 00000000 > CheckSum 00000000 > Subsystem 00000000 (unspecified) > DllCharacteristics 00000000 > SizeOfStackReserve 0000000000000000 > SizeOfStackCommit 0000000000000000 > SizeOfHeapReserve 0000000000000000 > SizeOfHeapCommit 0000000000000000 > LoaderFlags 00000000 > NumberOfRvaAndSizes 00000000 > > The Data Directory > Entry 0 0000000000000000 00000000 Export Directory [.edata (or where ever > we found it)] > Entry 1 0000000000000000 00000000 Import Directory [parts of .idata] > Entry 2 0000000000000000 00000000 Resource Directory [.rsrc] > Entry 3 0000000000000000 00000000 Exception Directory [.pdata] > Entry 4 0000000000000000 00000000 Security Directory > Entry 5 0000000000000000 00000000 Base Relocation Directory [.reloc] > Entry 6 0000000000000000 00000000 Debug Directory > Entry 7 0000000000000000 00000000 Description Directory > Entry 8 0000000000000000 00000000 Special Directory > Entry 9 0000000000000000 00000000 Thread Storage Directory [.tls] > Entry a 0000000000000000 00000000 Load Configuration Directory > Entry b 0000000000000000 00000000 Bound Import Directory > Entry c 0000000000000000 00000000 Import Address Table Directory > Entry d 0000000000000000 00000000 Delay Import Directory > Entry e 0000000000000000 00000000 CLR Runtime Header > Entry f 0000000000000000 00000000 Reserved > > Sections: > Idx Name Size VMA LMA File off > Algn > 0 .text 00000008 00000000 00000000 000000dc 2**2 > CONTENTS, ALLOC, LOAD, RELOC, CODE > 1 .idata$7 00000004 00000000 00000000 000000e4 2**2 > CONTENTS, RELOC > 2 .idata$5 00000004 00000000 00000000 000000e8 2**2 > CONTENTS, RELOC > 3 .idata$4 00000004 00000000 00000000 000000ec 2**2 > CONTENTS, RELOC > 4 .idata$6 00000014 00000000 00000000 000000f0 2**2 > CONTENTS > SYMBOL TABLE: > [ 0](sec 1)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .text > [ 1](sec 2)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$7 > [ 2](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$5 > [ 3](sec 4)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$4 > [ 4](sec 5)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$6 > [ 5](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 _g_strdup_printf > [ 6](sec 3)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 > __imp__g_strdup_printf > [ 7](sec 0)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 > __head_libglib_2_0_0_dll > > > RELOCATION RECORDS FOR [.text]: > OFFSET TYPE VALUE > 00000002 dir32 .idata$5 > > > RELOCATION RECORDS FOR [.idata$7]: > OFFSET TYPE VALUE > 00000000 rva32 __head_libglib_2_0_0_dll > > > RELOCATION RECORDS FOR [.idata$5]: > OFFSET TYPE VALUE > 00000000 rva32 .idata$6 > > > RELOCATION RECORDS FOR [.idata$4]: > OFFSET TYPE VALUE > 00000000 rva32 .idata$6 > > -- mvh. Patrick Hanevold ITF AS, Strandveien 35, 1366 LYSAKER Mob: 97 77 56 12, Fax: 67 82 91 11 e-mail: ph...@3i.... web: www.3i-taxi.no |