[Haskell-cafe] partial solved problem installing postgreSQL-libpq on Windows?

Kees Bleijenberg K.Bleijenberg at lijbrandt.nl
Thu Jun 16 09:47:34 UTC 2016

Maybe I've found a part of the solution. I changed in postgresql-libpq.cabal
Extra-Libraries: from pq to libpq.

Then runHaskell xx configure -ghc, runHaskell xx build and then runHaskell
xx install. No errors.. I'am happy.

But. if I  try to install postgresql-simple or hasql I get this error :


<command line>: can't load .so/.DLL for:
d:/PROGRA~2/POSTGR~1/9.3/lib\libpq.dll (addDLL: could not load DLL)

ghc.exe: d:/PROGRA~2/POSTGR~1/9.3/lib\libpq: %1 is not a valid Win32



dir d:\PROGRA~2\POSTGR~1\9.3\lib\libpq.dll finds the dll, but
d:/PROGRA~2/POSTGR~1/9.3/lib/libpq.dll  gives: 'Parameter format not

These mangled filenames come from pg_config.exe.

Is this a filename mangling problem? Any idea what is going on?






I want to install postgreSQL-libpq on Windows 7 64 bits with ghc version
7.10.1 and cabal version

This is what I did: 

Installed mingw

>From the msys prompt: pexports "d:\program
files\postgreSQL\9.3\bin\libpq.dll" > libpq.def

>From the msys prompt: dlltool  -d libpq.def -l libpq.a

The file libpq.a is created. I copied the file to d:\program
files\postgreSQL\9.3\bin\ and then from de cmd prompt:

cabal install postgreSQL-libpq --extra-include-dirs="d:\program
files\postgreSQL\9.3\include" --extra-lib-dirs="d:\program

I get: 

Resolving dependencies...

Configuring postgresql-libpq-

Failed to install postgresql-libpq-

Build log (
C:\Users\kees\AppData\Roaming\cabal\logs\postgresql-libpq- ):

[1 of 1] Compiling Main             (
D:\Temp\cabal-tmp-6140\postgresql-libpq-\dist\setup\Main.o )

Linking D:\Temp\cabal-tmp-6140\postgresql-libpq-\dist\setup\setup.exe

Configuring postgresql-libpq-

setup.exe: Missing dependency on a foreign library:

* Missing C library: pq

This problem can usually be solved by installing the system package that

provides this library (you may need the "-dev" version). If the library is

already installed but in a non-standard location then you can use the flags

--extra-include-dirs= and --extra-lib-dirs= to specify where it is.


What can I do?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160616/65d2393e/attachment-0001.html>

More information about the Haskell-Cafe mailing list