安装 friday-DevIL 时出错 - "Missing C Library: IL" Windows

Error Installing friday-DevIL - "Missing C Library: IL" on Windows

我遇到的问题与此处列出的问题类似:Trying to install Image.Codec.DevIL under windows. Needs pthread and IL. Can't get IL to work但我似乎无法按照评论中的小建议解决它。

我 运行 在 Windows 7 上安装 Haskell 平台,我正在尝试安装和使用 friday 软件包 https://hackage.haskell.org/package/friday

我可以成功 运行 cabal install package friday 但是当尝试 运行 cabal install package friday-devil 时,软件包安装失败并出现以下错误:

Resolving dependencies... 
Configuring friday-devil-0.1.1.1... 
Failed to install friday-devil-0.1.1.1 Last 10 lines of the build log ( C:\Users\Chris\AppData\Roaming\cabal\logs\friday-devil-0.1.1.1.log):     
Configuring friday-devil-0.1.1.1...
setup-Cabal-1.18.1.3-x86_64-windows-ghc-7.8.3.exe: Missing dependency on a foreign library:    
* Missing C library: IL 
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. 
cabal: Error: some packages failed to install: 
friday-devil-0.1.1.1 failed during the configure step. The exception was: 
ExitFailure 1

我已经安装了在 http://openil.sourceforge.net/ 找到的库,我还尝试使用上面建议的 --extra-include-dirs=--extra-lib-dirs= 选项手动指定 DevIL 中包含的库的位置.

我也尝试过 运行 使用 MSYS2 shell 和通过 cygwin(运行当时没有想法)。

我认为另一个答案可能与 pthreads 有关,但我只是尝试安装它并引用它,但似乎没有任何改变。

我不确定此时还可以尝试什么,任何想法都非常感谢。

编辑:我在 Ubuntu 14 中遇到了完全相同的问题,一定有一个步骤我 missing/not 在某处理解。

进一步编辑:我已按照此答案中的建议,通过 运行ning sudo apt-get install libdevil-dev 在 Ubuntu 中克服了这个困难:

还尝试了此页面上列出的所有内容:https://github.com/RaphaelJ/friday-devil/wiki/Windows 但错误仍然存​​在。

我想我需要弄清楚 Windows?

中的等价物是什么

我最终设法使用步骤 here 并进行了一些调整来实现它。

DevIL C libraries do not come with friday-devil. Those trying to use friday-devil on Windows can use the following procedue:

  1. Download prebuilt Windows binaries and header files. These are currently hosted from sourceforge in the "DevIL Windows SDK" folder. You will need either x86 or the x64 variant depending on which version of GHC you are using.

  2. Extract the archive somewhere on your hard drive such as C:\DevIL-1.7.8-x64.

  3. Unpack friday-devil with cabal unpack friday-devil.

  4. Edit the "friday-devil.cabal" file so that the "Extra-Libraries" field specifies "DevIL" instead of "IL".

    Extra-Libraries: DevIL

  5. install friday-devil with cabal install friday-devil --extra-lib-dirs=c:\devil-1.7.8-x64 --extra-include-dirs=c:\devil-1.7.8-x64\include.

第 3 步创建一个目录,例如friday-devil-0.1.1.1,这是您需要编辑的 .cabal 文件所在的位置。

我在第 5 步中尝试 运行 命令时没有成功。相反,我不得不 cd 进入第 3 步中创建的 friday-devil-0.1.1.1 目录,然后简单地 运行:

cabal install --extra-lib-dirs=c:\devil-1.7.8-x64 --extra-include-dirs=c:\devil-1.7.8-x64\include. 

未指定 friday-devil.

可能是这样的,当 运行 执行完整命令时,cabal 使用的是以前下载的版本(尽管昨天我有理由确定我也更改了 cabal 目录中的下载包)。我可能会在某个时候在另一个系统上重新访问它,但是上面更改的 cabal install 步骤已经解决了我眼前的问题。

我敢肯定它可能只是 simple/obvious 对于更熟悉 cabal 的人来说(我是新手),但我会把它留在这里,以防它对某人有帮助.