That did it, thanks. Instead of using ghc's -L/-l flags, I used: -optl c:\windows\system32\ntwdblib.dll
> -----Original Message----- > From: Sigbjorn Finne [mailto:[EMAIL PROTECTED] > Sent: 28 April 2005 01:04 > To: Bayley, Alistair > Cc: glasgow-haskell-users@haskell.org > Subject: Re: Linker errors when using FFI on Windows > > Adding the -Lc:\windows\system32 option when linking upsets > the resolution of misc standard libraries, causing 'ld' to > use the DLLs > rather than the mingw link libraries, including msvcrt.dll. > > Try just using c:/windows/system32/ntwdblib.dll on the link > line instead. > If ld's DLL auto-import support doesn't quite work, attempting to link > with the import library 'ntwdblib' (ntwdblib.lib ?) instead > is worth a shot. > The SQL Server SDK ought to include that somewhere. > > hth > --sigbjorn > > ----- Original Message ----- > From: "Bayley, Alistair" <[EMAIL PROTECTED]> > To: <glasgow-haskell-users@haskell.org> > Sent: Wednesday, April 27, 2005 08:10 > Subject: Linker errors when using FFI on Windows > > > > I'm trying to link an FFI program against a Windows (XP) DLL > > (c:\windows\system32\ntwdblib - this is the MS Sql Server > client library). > > The output from ghc6.4 -v is below; the errors start in the Linker > > section. > > > > Comments: > > > > - Where do these objects d0000xx.o come from? (They're not in my > > source...) > > > > d000013.o(.text+0x0): multiple definition of `_onexit' > > c:/ghc/ghc-6.4/gcc-lib/crt2.o(.text+0x2a0):crt1.c: first > defined here > > d000018.o(.text+0x0): multiple definition of `atexit' > > c:/ghc/ghc-6.4/gcc-lib/crt2.o(.text+0x280):crt1.c: first > defined here > > > > > > - Have I omitted some important linker flag? There are tons of these > > undefined references from crt2.o, like this: > > > > c:/ghc/ghc-6.4/gcc-lib/crt2.o(.text+0x238):crt1.c: > undefined reference to > > [EMAIL PROTECTED]' > > > > > > Thanks, > > Alistair. > > > > ----------------------------------------- ***************************************************************** Confidentiality Note: The information contained in this message, and any attachments, may contain confidential and/or privileged material. It is intended solely for the person(s) or entity to which it is addressed. Any review, retransmission, dissemination, or taking of any action in reliance upon this information by persons or entities other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender and delete the material from any computer. ***************************************************************** _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users