我正在尝试建立一个使用该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
到我的 PATH 中。据我所知,这可以按预期工作,因为我已经解决了一个关于pg_config
丢失的错误,而是我目前遇到的错误。
其次,我还尝试将lib
andinclude
目录添加到我的 PATH 中,但这并没有改变错误。
我还应该提到我的 Postgres 安装本身就可以正常工作。