Cabal install needs C library: Windows
Asked Answered
B

1

8

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)

Barela answered 12/9, 2011 at 0:40 Comment(2)
Which version of GHC and cabal are you using?Mccafferty
GHC 7.0.3, cabal-install version 0.10.2, Windows 7 (32 bit)Barela
B
10

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.

Barela answered 12/9, 2011 at 16:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.