我正在尝试设置一个使用postgresql-simple包的堆栈项目。当尝试stack build时,安装postgresql-simple的所有依赖项都没有问题,但是堆栈在安装postgresql-simple本身时遇到了问题。我得到以下错误:
C:project> stack build --extra-include-dirs="C:\PostgreSQL\8.4\include" --extra-lib-dirs="C:\PostgreSQL\8.4\lib"
... omitted ...
*****************
--extra-include-dirs=C:\PostgreSQL\8.4\include
*****************
--extra-include-dirs=C:\Users\User\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw32\include
--extra-include-dirs=C:\Users\User\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include
*****************
--extra-lib-dirs=C:\PostgreSQL\8.4\lib
*****************************
--extra-lib-dirs=C:\Users\User\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw32\lib
--extra-lib-dirs=C:\Users\User\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
Process exited with code: ExitFailure 1
Logs have been written to: C:\Users\User\Desktop\draftkings\NFAccuracy\.stack-work\logs\postgresql-libpq-0.9.1.1.log
Configuring postgresql-libpq-0.9.1.1...
Setup.hs: 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.我也尝试在我的stack.yaml文件中指定路径,同样的错误。
我尝试手动复制库,并将文件从postgres安装包含到提到的...\mingw64\lib和...\mingw64\include文件夹中。同样的错误。
我的libpq.dll和libpq.lib文件都在C:\PostgreSQL\8.4\lib文件夹中。
我觉得我错过了一些显而易见的东西,但我不能让它起作用,我不知道我做错了什么。任何帮助都是非常感谢的。
更新
我忘了提两个重要的细节。
首先,我在我的路径中添加了C:\PostgreSQL\8.4\bin。据我所知,这与预期的一样,因为我通过了一个关于pg_config丢失的错误,而忽略了我目前所犯的错误。
其次,我还尝试将lib和include目录添加到我的路径中,但这并没有改变错误。
我也应该提到我的Postgres安装工程本身很好。
发布于 2015-10-15 04:35:57
我知道这个雪堆项目使用PostgreSQL并在Windows上使用Stack构建。他们的网站上有建造指南。看上去有一个不同之处,就是他们提到:
将PostgreSQL bin目录添加到路径
C:\Program Files (x86)\PostgreSQL\9.4\bin
你能试着把它添加到路径中,看看是否修复了它吗?
发布于 2015-10-23 05:56:56
有某种版本错配。
安装Postgres 9.4而不是8.4允许以我尝试的方式构建postgresql-simple包。
我的堆栈项目(不需要我的干预)默认使用resolver: 'lts-3.7' --这为我的项目提供了0.4.10.0版本的postgresql-simple包。我希望我有一个更详细的答案,但我所能知道的是,这个版本的postgresql-simple (这是最近的)在PostgreSQL 9.4 (也是最近的)中运行得很好。
幸运的是,使用针对Postgres 9.4库构建的haskell和postgresql-simple与我的“远程”(virtualbox)数据库( Postgres 8.4 )通信没有问题。
我很想指出我的问题不是建设性的,除非其他人发现这个有用的信息。
https://stackoverflow.com/questions/33130252
复制相似问题