我是一個Haskell總新手,我正在做一個小項目,但我需要運行cabal install encoding
。但是,當我這樣做,它給了我這個錯誤:在Haskell中,如何在Windows上安裝編碼包?
Configuring encoding-0.6.7.2...
setup.exe: Missing dependency on a foreign library:
* Missing (or bad) header file: system_encoding.h
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.
cabal.exe: Error: some packages failed to install:
encoding-0.6.7.2 failed during the configure step. The exception was:
ExitFailure 1
如何解決這個問題?
作爲一般規則,查看cabal文件中的標誌可以指向有用的方法來避免需要外部庫,這可能會犧牲某些API或某些功能。很高興我能幫上忙! – fryguybob 2013-03-15 12:26:31
@fryguybob:你如何看待它? – 2013-03-15 16:47:35
在hackage頁面的底部有一個鏈接,用於打開cabal文件的「包描述」。你也可以做'cabal unpack ...',然後將這個軟件包解壓縮到一個可以查看源代碼的目錄中。 'cabal info ...'也會列出這些標誌,但並不包含他們所做的更多信息。 – fryguybob 2013-03-15 17:25:00