IreneKnapp / direct-sqlite

MIT License
35 stars 54 forks source link

Linking failure on MS Windows XP #48

Closed paul-r-ml closed 10 years ago

paul-r-ml commented 10 years ago

Hi Irene,

thank you very much for this nice package, it works great.

However, I tried today to build a project of mine on MS Windows XP, and it failed on the package :

Loading package direct-sqlite-2.3.13 ... linking ... ghc.exe: C:\MinGW\msys\1.0\ home(...).cabal-sandbox\i386-windows-ghc-7.4.1\direct-sqlite-2.3.13\libHSdirect- sqlite-2.3.13.a: unknown symbol ___fixunsdfdi' ghc.exe: unable to load packagedirect-sqlite-2.3.13'

I don't know what to do from here. Can you help me please ?

The setup is WinXP 32 + MINGW + GHC 7.4 + cabal 1.18.0 All happen in a clean cabal sandox.

Thank you, regards,

IreneKnapp commented 10 years ago

Hi, Paul,

Thank you for the praise. I haven't encountered this problem before, and don't have a MINGW setup to test against, but I googled around a bit (in particular, I looked for the symbol name, ___fixunsdfdi). It seems to be a floating-point call... Not a Windows-specific one; there are hits in all manner of compilers and C library implementations. So my best guess would be that you need to include the MINGW math library into the link step, somehow? On Linux it would be something like:

if os(unix) extra-libraries: m

... added to the .cabal file. But on Windows, the library will probably be called something different, and of course you'll have to look up how to actually tell Cabal to conditionalize it on the Windows platform.

Hope that at least starts you on the right track?

paul-r-ml commented 10 years ago

Hi Irene, thank you for the tip. I will work on it and report as soon as I have results.

paul-r-ml commented 10 years ago

After a reboot and a clean build, I can't reproduce the issue, it now builds fine. No idea what happened, maybe some MSWin magic unrelated to your package. Thank you a ton again for your kind support Irene, have a nice day.

IreneKnapp commented 10 years ago

How odd! Don't you hate when that happens? Well, at least it works now! :) Have a nice day!

paul-r-ml commented 10 years ago

Indeed I hate that. Fortunately, I only work on MS Win systems a few days in a year, mainly when a user needs a build on this platform. Admittedly, I am highly incompetent there, any decent windows programmer would have rebooted twice before posting a bug report :)