Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cabal install needs C library: Windows

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)

like image 836
Dan Burton Avatar asked Sep 12 '11 00:09

Dan Burton


1 Answers

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.

like image 115
Dan Burton Avatar answered Oct 23 '22 02:10

Dan Burton