简体   繁体   中英

Haskell: Can not install SDL-0.6.2 on windows

I am trying to install the Haskell SDL-0.6.2 package on Windows 7 with ghc 6.12.1 (Haskell Platform). I end up getting the following output from cabal:

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 seems to be installed properly on my machine, at least I can get a sample C program to run using MinGW and gcc.

Did anyone run into the same problem? I found a link here but the solution proposed (minor change to hsc2hs) does not seem to apply to me. Any help would be appreciated!

EDIT: So I finally got it to run, though I do not know exactly how... Figured I have to run "cabal install" inside a bash and fiddle around with sdl-config (removed "-lmingw32 -lSDLmain -lSDL.dll -mwindows" from it's "--lib" tag). But I doubt that I could reproduce my result when trying a second time...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM