Cabal安装需要C库:Windows
我试图在我的Windows机器上安装 cabal install yesod
。我有一个相对全新的Haskell平台安装。 cabal安装失败,报告说我需要sqlite3 C库来安装Yesod依赖的程序包persistent。
I am trying to cabal install yesod
on my Windows machine. I have a relatively fresh install of the Haskell Platform. The cabal install failed, reporting that I need the sqlite3 C library in order to install "persistent", a package which Yesod relies upon.
cabal: Missing dependency on a foreign library:
* Missing C library: sqlite3
所以我去了 http://www.sqlite.org/download .html 并抓取C源代码和预编译的二进制文件。我尝试使用两种方法,但都无济于事:
So I went to http://www.sqlite.org/download.html and grabbed both the C source and the precompiled binary. I tried using both, to no avail:
cabal install persistent --extra-lib-dirs=C:\Path\To\C\Source\Files
cabal install persistent --extra-lib-dirs=C:\Path\To\Binary
在这两种情况下,我都得到了相同的结果:它不起作用。 :(我能做些什么来给cabal提供它所需要的C库?(本例中为sqlite3)
In both cases, I got the same result: it didn't work. :( What can I do to give cabal the C library it needs? (sqlite3 in this case)
所以,facepalm。我不需要源代码,我不需要exe。我需要dll。
So, facepalm. I didn't need the source, I didn't need the exe. I needed the dll.
在预编译的Windows二进制文件在我的问题中提到的网站部分,我下载并提取了带有 sqlite3.def
和 sqlite.dll
的zip文件>。然后我使用
Under the "precompiled binaries for Windows" section of the website mentioned in my question, I downloaded and extracted the zip file with sqlite3.def
and sqlite.dll
. Then I used
cabal install persistent --extra-lib-dirs=C:\Path\To\DllAndDef
安装看起来已经成功完成,之后我做了一个 cabal安装yesod
,这也似乎已经成功完成。
The installation appears to have completed successfully. Afterwards, I did a cabal install yesod
, which also appears to have completed successfully.
我想如果我把dll放在了某个神奇的地方,那么我就不会有必须使用 - extra-lib-dirs =
选项。
I suppose if I had put the dll somewhere magical, then I wouldn't have had to use the --extra-lib-dirs=
option.