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.
就研究到这个地方,问题未得到解决。。。
新闻热点
疑难解答