2011-11-03 96 views
5

我想在Windows 7上用ghc 6.12.1(Haskell平台)安装Haskell SDL-0.6.2软件包。我最终从阴谋得到以下的输出:Haskell:无法在Windows上安装SDL-0.6.2

C:\Users\Martin\dev\Rasenschach_0>cabal install SDL 
Resolving dependencies... 
[1 of 1] Compiling Main    (C:\Users\FAMILI~1\AppData\Local\Temp\SDL-0 
.6.25076\SDL-0.6.2\Setup.lhs, C:\Users\FAMILI~1\AppData\Local\Temp\SDL-0.6.25076 
\SDL-0.6.2\dist\setup\Main.o) 

C:\Users\FAMILI~1\AppData\Local\Temp\SDL-0.6.25076\SDL-0.6.2\Setup.lhs:2:2: 
    Warning: In the use of `defaultUserHooks' 
      (imported from Distribution.Simple): 
      Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you n 
eed Cabal-1.2 
      compatibility in which case you must stick with defaultUserHooks" 
Linking C:\Users\FAMILI~1\AppData\Local\Temp\SDL-0.6.25076\SDL-0.6.2\dist\setup\ 
setup.exe ... 
Warning: defaultUserHooks in Setup script is deprecated. 
Configuring SDL-0.6.2... 
configure: WARNING: unrecognized options: --with-hc 
checking for sdl-config... /usr/bin/sdl-config 
configure: creating ./config.status 
config.status: creating config.mk 
config.status: creating SDL.buildinfo 
config.status: creating includes/HsSDLConfig.h 
configure: WARNING: unrecognized options: --with-hc 
Preprocessing library SDL-0.6.2... 
dist\build\Graphics\UI\SDL\General_hsc_make.o:General_hsc_make.c:(.text+0x0): mu 
ltiple definition of `main' 
/MinGW/lib/libmingw32.a(main.o):main.c:(.text+0x0): first defined here 
/MinGW/lib/libSDLmain.a(SDL_win32_main.o): In function `console_main': 
/Users/hercules/trunk/SDL-1.2/./src/main/win32/SDL_win32_main.c:315: undefined r 
eference to `SDL_main' 
collect2: ld returned 1 exit status 
linking dist\build\Graphics\UI\SDL\General_hsc_make.o failed 
command was: C:\Program Files\Haskell Platform\2010.1.0.0\mingw\bin\gcc.exe -lSD 
L -L/MinGW/lib -lmingw32 -lSDLmain -lSDL -mwindows -LC:\Program Files\Haskell Pl 
atform\2010.1.0.0\base-4.2.0.0 -lwsock32 -luser32 -lshell32 -LC:\Program Files\H 
askell Platform\2010.1.0.0\integer-gmp-0.2.0.0 -LC:\Program Files\Haskell Platfo 
rm\2010.1.0.0\ghc-prim-0.2.0.0 -LC:\Program Files\Haskell Platform\2010.1.0.0 -L 
C:\Program Files\Haskell Platform\2010.1.0.0/gcc-lib -lm -lwsock32 -LC:\Program 
Files\Haskell Platform\2010.1.0.0 dist\build\Graphics\UI\SDL\General_hsc_make.o 
-o dist\build\Graphics\UI\SDL\General_hsc_make.exe 
cabal: Error: some packages failed to install: 
SDL-0.6.2 failed during the building phase. The exception was: 
ExitFailure 1 

libSDL似乎是我的机器上正确安装,至少我可以得到一个C程序示例使用MinGW和gcc的运行。

有没有人遇到同样的问题?我找到了一个链接here,但提出的解决方案(对hsc2hs的小改动)似乎并不适用于我。任何帮助,将不胜感激!

编辑︰所以我终于得到它运行,虽然我不知道究竟如何......我必须运行“cabal安装”内bash和小提琴与sdl配置(删除“-lmingw32 -lSDLmain -lSDL.dll -mwindows“从它的”--lib“标签)。但我怀疑,试图第二次的时候,我可以复制我的结果...

+0

有在WIN32文件说明在SDL包的源代码分发,帮助我编译并在Win7/mingw上运行它。 –

+0

@fs:谢谢,我没有看到!我会试一试! – martingw

+0

@fs:我试过了(改变了Cabal-Files中的extra-libraries-line),但仍然得到相同的错误。 – martingw

回答