Cabal install needs C library: Windows

人盡茶涼 提交于 2019-12-04 19:56:37

问题


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

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

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)


回答1:


So, facepalm. I didn't need the source, I didn't need the exe. I needed the dll.

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

The installation appears to have completed successfully. Afterwards, I did a cabal install yesod, which also appears to have completed successfully.

I suppose if I had put the dll somewhere magical, then I wouldn't have had to use the --extra-lib-dirs= option.



来源:https://stackoverflow.com/questions/7382334/cabal-install-needs-c-library-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!