[Haskell-cafe] Fwd: Trouble using HDBC-postgres on Windows - can'tfind libpq.dll

Bayley, Alistair Alistair_Bayley at invescoperpetual.co.uk
Tue Nov 13 10:09:16 EST 2007

> From: haskell-cafe-bounces at haskell.org 
> [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Justin Bailey
> Well, I answered my own question. Unlike UNIX, specifying a library
> without the leading "lib" causes the library to not be found. Not sure
> if that's a GHC linking problem or what. Changing the library
> requirement to "libpq" in the .cabal file did the trick tho.

This seems to be a bit different from what I discovered when cabalising

ghc uses gnu ld, which seems to be smart enough to know that -lpq means
"find libpq.dll or pq.dll". ghci's linker/loader isn't so slick. If you
say -lpq to ghci, it looks for pq.dll only. So I just copied libpq.dll
to pq.dll, so that they both exist.

You're using runghc, so I guess that must use ghci, or something
equivalent. You may find, now that you've changed the cabal entry to
libpq, that you can no longer build with ghc (the compiler). But my
memory of this is hazy. I think it's better to stick with "pq" in the
cabal file (and copy libpq.dll to pq.dll), because this works for Unix
systems too.

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.

More information about the Haskell-Cafe mailing list