1. 運行命令cabal install glib時出現錯誤:
Cannot find gtk2hsC2hsPlease install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin).2. 運行命令cabal install gtk2hs-buildtools
Installed gtk2hs-buildtools-0.12.5.2
3. 重新運行命令cabal install glib,出現新的錯誤:
The PRogram pkg-config version >=0.9.0 is required but it could not be found.
4. 下載/安裝GTK+ all-in-one bundle
a) 下載網址:http://www.gtk.org/download/win32.php,直接下載鏈接:http://win32builder.gnome.org/gtk+-bundle_3.6.4-20130921_win32.zip。
b) 下載后,解壓至一個文件夾,比如F:/GTK,并將該文件夾路徑添加至PATH環境變量中
setx /M PATH "%PATH%;F:/GTK"
5. 重新運行命令cabal install glib,出現新的錯誤:
The pkg-config package glib-2.0 is required but it could not be found.
6. 運行命令pkg-config --modversion glib-2.0,出現錯誤:
ackage glib-2.0 was not found in the pkg-config search path.Perhaps you should add the directory containing `glib-2.0.pc'to the PKG_CONFIG_PATH environment variableNo package 'glib-2.0' found
7. 在F:/GTK中添加glib-2.0.pc文件,文件內容如下:
prefix=F:/GTKexec_prefix=F:/GTKlibdir=F:/GTKincludedir=F:/GTKglib_genmarshal=glib-genmarshalgobject_query=gobject-queryglib_mkenums=glib-mkenumsName: GLibDescription: C Utility LibraryVersion: 2.0Libs: -L${libdir} -lglib-2.0 Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include
8. 重新運行命令cabal install glib,又出現新的錯誤:
The pkg-config package gobject-2.0 is required but it could not befound.在F:/GTK中添加gobject-2.0.pc文件
9. 重新運行命令cabal install glib,又出現新的錯誤:
Missing dependencies on foreign libraries:* Missing C libraries: glib-2.0, gobject-2.0This problem can usually be solved by installing the system packages thatprovide these libraries (you may need the "-dev" versions). If the librariesare already installed but in a non-standard location then you can use theflags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
就研究到這個地方,問題未得到解決。。。
新聞熱點
疑難解答