Question

I am on windows XP. I have installed Yesod by following the steps on this page: http://www.yesodweb.com/page/five-minutes

I have created a scaffolded application with Postgresql persistence. When I ran "yesod devel" for the first time it gave me an error about some postgresql package missing (I do not remember the name), so I installed it using cabal. now when I run "yesod devel" it gives me the error below:

Loading package HDBC-postgresql-2.2.3.3 ... ghc.exe: pq: The specified module co
uld not be found.
: can't load .so/.DLL for: pq (addDLL: could not load DLL)
yesod: Network.Socket.accept: failed (No error)
I have HDBC-postgresql-2.2.3.3 installed and I have installed it with the --extra-lib-dirs set to the postgresql's bin folder wih all the DLLs but it did not help.

As far as I understand it is trying to load pq.dll, but I do not have it on my system, I have libpq.dll, so I tried to rename the dll, to no avail. I am lost.

Please help

Konstantin

Was it helpful?

Solution

On Windows, %path% needs to be set correctly. I have postgresql installed under "Program Files", and for some reason HDBC-postgresql does not like the fact that the path contains a space, so I ended up adding the 8.3 path version to the %path% and it seemed to have solved the problem.

OTHER TIPS

You need to set your windows path correctly. Ghc requires the following path set for postgreSQL ODBC as "C:\Program Files\PostgreSQL\psqlODBC\0903\bin" on the command line(Use ODBC version and change it appropriately). In addition, your postgreSQL bin path should be set. Install the odbc driver after you set the ODBC path. If ODBC dlls are linked properly, the error will disappear. If odbc linking is not done properly, setting cabal flag --extra-lib-dirs will not work. The required file libpq.dll is in odbc bin directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top