尝试在Windows下安装Image.Codec.DevIL。需要 pthread 和 IL。无法让 IL 工作
这是 cabal install codec-image-devil
的输出:
Resolving dependencies...
Configuring Codec-Image-DevIL-0.2.3...
cabal: 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:
Codec-Image-DevIL-0.2.3 failed during the configure step. The exception was:
ExitFailure 1
我尝试了 --extra-include-dirs
和 --extra-lib-dirs
>。但他们没有工作。所以我在Codec-Image-DevIL-0.2.3.tar.gz
中编辑了.cabal。我不知道我是否应该改变这一点。但它适用于pthread
。
我添加了这两行:
include-dirs: C:\Users\Rumbold\Documents\libs\IL\include, C:\Users\Rumbold\Documents\libs\pthread\include, .
extra-lib-dirs: C:\Users\Rumbold\Documents\libs\IL\lib, C:\Users\Rumbold\Documents\libs\pthread\lib, .
它们是缩进的,因此位于 Library
部分中。我不知道我的列表格式是否正确,这只是我在谷歌搜索时偶然发现的东西。我认为库和头文件都位于正确的位置。
有什么线索我可以让它工作吗?
Edit_1:
我让它与 --extra-include-dirs
和 --extra-lib-dirs
一起使用,所以我不需要再编辑 cabal 了。但IL仍然不起作用。有没有办法找出它正在寻找哪些文件?
Wdit_2:
好的,可以了。我必须将 DevIL.lib
和 DevIL.dll
重命名为 libIL.lib
和 libIL.dll
。 (不确定我是否必须两者都做,但这就是我所做的。也将它们保留在旧名称下)
Edit_3:
收到很多错误,例如:
"cabal\Codec-Image-DevIL-0.2.3\ghc-6.12.3/libHSCodec-Image-DevIL-0.2.3.a(DevIL.o):fake:(.text+0x2379):
undefined reference to `ilGetInteger@4'"
This is the output from cabal install codec-image-devil
:
Resolving dependencies...
Configuring Codec-Image-DevIL-0.2.3...
cabal: 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:
Codec-Image-DevIL-0.2.3 failed during the configure step. The exception was:
ExitFailure 1
I tried --extra-include-dirs
and --extra-lib-dirs
. but they didn't work. so I edited the .cabal in Codec-Image-DevIL-0.2.3.tar.gz
. I don't know if I'm even supposed to change that. but it worked for pthread
.
I added these two lines:
include-dirs: C:\Users\Rumbold\Documents\libs\IL\include, C:\Users\Rumbold\Documents\libs\pthread\include, .
extra-lib-dirs: C:\Users\Rumbold\Documents\libs\IL\lib, C:\Users\Rumbold\Documents\libs\pthread\lib, .
They are indented so they are in the Library
section. I don't know if I got the format for lists right, just something i stumbled upon while googling. The libs and `header files are all in the correct place, I think.
any clue how i can get it to work?
Edit_1:
I got it to work with --extra-include-dirs
and --extra-lib-dirs
, so I don't need to edit the cabal anymore. but IL still doesn't work. is there a way to find out which files it's looking for?
Wdit_2:
Alright it works. I had to rename DevIL.lib
and DevIL.dll
to libIL.lib
and libIL.dll
. (not sure if I had to do both, but that's what I did. also kept them under their old names)
Edit_3:
Getting lots of errors like:
"cabal\Codec-Image-DevIL-0.2.3\ghc-6.12.3/libHSCodec-Image-DevIL-0.2.3.a(DevIL.o):fake:(.text+0x2379):
undefined reference to `ilGetInteger@4'"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论