haskell - SDL_image 无法安装

标签 haskell compiler-errors sdl-image

我正在尝试安装 SDL-image library对于 Haskell,是一组同名原始 C 库的绑定(bind)。我已经构建并安装了 SDL 库及其相应的 Haskell 包,并将文件从 SDL 图像库拖放到安装 SDL 的目录中。现在,当我尝试安装 SDL 图像绑定(bind)时,出现以下错误:

$ runghc Setup.lhs configure
Configuring SDL-image-0.6.1...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for sdl-config... /usr/bin/sdl-config
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... .o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for IMG_Load in -lSDL_image... no
configure: error: *** SDL_image lib not found! Get SDL_image from http://www.libdsl.org/projects/SDL_image/index.html

一些粗略的谷歌搜索告诉我,我应该告诉configure在哪里可以找到lib文件,但我不知道如何去做。我尝试过使用 gcc 标志 -l[directory],但得到了相同的结果。

我在 Win7x64 上使用 MinGW。预先感谢您的任何帮助,如果我没有提供足够的信息,我深表歉意,我不确定什么是重要的,因为我不太了解这个问题。

最佳答案

我不确定 SDL_image,但我已经成功为 Haskell 构建了 SDL。无需编辑 cabal 文件。

假设您安装了 Haskell Platform、MINGW 和 MSYS,以及 SDL 的 MINGW 版本,您只需将 C_INCLUDE_PATHLIBRARY_PATH 环境变量设置为指向到 SDL 的 header 和库。

完成此操作后,您可以使用 MINGW shell 运行 cabal install SDL

关于haskell - SDL_image 无法安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13719458/

相关文章:

string - 学习 Haskell : String manipulation question

c++ - 创建对象数组的问题 C++

c++ - 代码:: block SDL2.0 "undefined reference to ' IMG_Load'"

haskell - 如何将附加参数传递给 Control.Monad.Reader 实例

c# - 从 C# 调用 Haskell

compiler-errors - 无法找到图像(使用Atom编码以在Ren'py Visual Novel Engine中创建Visual Novel)

c++ - 这些错误是什么意思?

c++ - 无法使用 IMG_Load() 加载图像

image - "Undefined Reference To ' IMG_Load '"代码块和 SDL_Image 错误

haskell - 有没有办法懒惰地 `read`?