我是不是能夠得到它安裝在我的系統。這是我的嘗試。奇怪的是,我能夠獲得配置查找頭文件,但不是實際的二進制文件。
讓我們試試吧。我已經安裝了新的2014 Haskell平臺。
cabal install sdl
Configuring SDL-0.6.5...
setup.exe: The package has a './configure' script. This requires a Unix
compatibility toolchain such as MinGW+MSYS or Cygwin.
Failed to install SDL-0.6.5
Haskell Platform中的GHC附帶了MinGW,所以我們可能需要安裝MSYS。所述MSYS page說安裝minggw get,它說安裝
一種自動GUI安裝助手稱爲mingw-get-setup.exe爲第一次安裝的優選方法。這將引導您的設置MinGW的,得到安裝正確;您將使用它來執行進一步的軟件包安裝並管理您的安裝。
運行使用默認選項安裝程序爲我們提供了以下畫面:
我們已經從MinGW的安裝Haskell的平臺,所以我們會在只點擊最後一個項目列表,msys-base,然後選擇「Mark for Installation」。然後,在左上角的「安裝」菜單中,選擇「應用更改」。這將詢問您是否確定繼續,我們選擇「應用」
此安裝程序未將MSYS基路徑,我們可以把它添加到路徑,並嘗試安裝SDL再次
set PATH=C:\MinGW\msys\1.0\bin\;%PATH%
cabal install sdl
Configuring SDL-0.6.5...
configure: WARNING: unrecognized options: --with-compiler, --with-gcc
checking for sdl-config... no
checking for sdl11-config... no
configure: error: *** SDL not found! Get SDL from www.libsdl.org.
If you already installed it, check it's in the path. If problem remains,
please send a mail to the address that appears in ./configure --version
indicating your platform, the version of configure script and the problem.
Failed to install SDL-0.6.5
我們需要下載並安裝libsdl。我去了libsdl download page和下載的Win32開發庫,SDL-devel-1.2.15-mingw32.tar.gz
。我提取了這個檔案(7-zip可以提取tar檔案和gzip壓縮文件)。爲方便起見,我將SDL-1.2.15
目錄移至c:
。要添加該的路徑,由以前的錯誤的建議,然後嘗試再次
set PATH=C:\SDL-1.2.15\bin\;%PATH%
cabal install sdl
* Missing (or bad) header file: SDL/SDL.h
* Missing C library: SDL
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.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
我們可以把這個錯誤的一部分消失加入建議--extra-include-dirs
標誌,但仍得到以下錯誤
cabal install sdl --extra-include-dirs=c:\SDL-1.2.15\include
* Missing C library: SDL
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.
添加--extra-lib-dirs
國旗c:\SDL-1.2.15\bin
或C:\SDL-1.2.15\lib
或c:\SDL-1.2.15
未能解決這個問題。
你在運行什麼操作系統? – Mokosha 2014-09-03 03:12:45
@Mokosha標題提及Windows。 – MasterMastic 2014-09-03 04:49:48
我想要解決第3部分: SDL和Haskell很好地結合在一起,但如果您真的想要充分利用Haskell的強大功能,無論是作爲功能語言,還是GUI應用程序中美麗而神奇的語言:使用FRP ([功能反應式編程](http://www.haskell.org/haskellwiki/Functional_Reactive_Programming))。在實踐方面,我建議使用反應性香蕉或鈉 - 它們幾乎是相同的(這很有趣,因爲它從來就不是這樣的意圖,而恰巧碰巧是這樣)。 – MasterMastic 2014-09-03 04:54:58