SDL_image 不会安装

Ein*_*nar 5 haskell compiler-errors sdl-image

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

$ 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
Run Code Online (Sandbox Code Playgroud)

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

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

stu*_*ith 1

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

假设您安装了 Haskell Platform、MINGW 和 MSYS,并且在某处安装了 SDL 的 MINGW 版本,您只需设置C_INCLUDE_PATHLIBRARY_PATH环境变量以指向 SDL 的标头和库。

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