partial solved problem installing postgreSQL-libpq on Windows?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

partial solved problem installing postgreSQL-libpq on Windows?

Kees Bleijenberg

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 application.



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 correct’.

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 files\postgreSQl\9.3\bin"

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\setup.hs, 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?



Haskell-Cafe mailing list
[hidden email]