Gau*_*tam 5 gtk install haskell gtk2hs
我已经安装了gtk2hs-buildtools没有问题,但是当我尝试使用'cabal install gtk'安装gtk时,这是输出:
[gautam@gautam ~]$ cabal install gtk Resolving dependencies... [1 of 2] Compiling SetupWrapper ( /tmp/cairo-0.12.213784/cairo-0.12.2/SetupWrapper.hs, /tmp/cairo-0.12.213784/cairo-0.12.2/dist/setup/SetupWrapper.o ) [2 of 2] Compiling Main ( /tmp/cairo-0.12.213784/cairo-0.12.2/Setup.hs, /tmp/cairo-0.12.213784/cairo-0.12.2/dist/setup/Main.o ) Linking /tmp/cairo-0.12.213784/cairo-0.12.2/dist/setup/setup ... [1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o ) [2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o ) Linking dist/setup-wrapper/setup ... Cannot find gtk2hsC2hs Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin). [1 of 2] Compiling SetupWrapper ( /tmp/glib-0.12.213784/glib-0.12.2/SetupWrapper.hs, /tmp/glib-0.12.213784/glib-0.12.2/dist/setup/SetupWrapper.o ) [2 of 2] Compiling Main ( /tmp/glib-0.12.213784/glib-0.12.2/Setup.hs, /tmp/glib-0.12.213784/glib-0.12.2/dist/setup/Main.o ) Linking /tmp/glib-0.12.213784/glib-0.12.2/dist/setup/setup ... [1 of 2] Compiling Gtk2HsSetup ( Gtk2HsSetup.hs, dist/setup-wrapper/Gtk2HsSetup.o ) [2 of 2] Compiling Main ( SetupMain.hs, dist/setup-wrapper/Main.o ) Linking dist/setup-wrapper/setup ... Cannot find gtk2hsC2hs Please install `gtk2hs-buildtools` first and check that the install directory is in your PATH (e.g. HOME/.cabal/bin). cabal: Error: some packages failed to install: cairo-0.12.2 failed during the configure step. The exception was: ExitFailure 1 gio-0.12.2 depends on glib-0.12.2 which failed to install. glib-0.12.2 failed during the configure step. The exception was: ExitFailure 1 gtk-0.12.2 depends on glib-0.12.2 which failed to install. pango-0.12.2 depends on glib-0.12.2 which failed to install. [gautam@gautam ~]$
我的Mac和我的Fedora VM都会出现此问题.有人知道如何解决这个问题吗?谢谢!
ehi*_*ird 10
您需要将Gtk2Hs构建工具存储的路径添加到$PATH环境变量中,以便构建过程可以找到它们.在Linux上,它是$HOME/.cabal/bin.在OS X上,它是$HOME/Library/Haskell/bin(虽然可能只是在你使用Haskell平台时 - 如果这不起作用,请尝试$HOME/.cabal/bin).
要添加目录,请$PATH运行.你应该把它添加到你的shell的启动文件中(它取决于你的shell和操作系统 - 可能是,或者).(无论如何,如果要运行直接安装的程序,则需要这样做.)export PATH=directory:$PATH~/.bashrc~/.profile~/.bash_profilecabal