Trying to compile Glade Gtk2Hs demo / cabal install glade problem

(I am posting this to Cafe and Gtk2Hs Users; if you subscribe to both, please reply to Cafe; but I will see your replies either place; thanks much.) I am trying to compile the Gtk2Hs demo program GladeTest.hs (located in the ...\demo\glade dir), under MS Windows XP. The error I get is: H:\proc\tools\Gtk2Hs\demo\glade>ghc --make GladeTest.hs GladeTest.hs:4:7: Could not find module `Graphics.UI.Gtk.Glade': (--Note:-- I am using H: instead of C: for reasons described later.) I did these okay: cabal install cabal-install cabal update cabal install gtk2hs-buildtools cabal install gtk and I can compile and run some other Gtk2Hs demos (that do not use Glade) okay. In general, I am assuming that I need to "cabal install foo" when Haskell module foo cannot be found during compile. (Please correct me if I am wrong.) I get an error during the glade install: H:\proc\dev\cmd>cabal install glade ... Configuring glade-0.11.1... setup.exe: The pkg-config package libglade-2.0 version >=2.0.0 is required but it could not be found. ... (the full output is listed below) I think I have package libglade-2.0 installed, because I installed the GTK+ and Glade bundle from: http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/3.6/glade3-3.6.7-with-G... at: http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/3.6/ at: http://glade.gnome.org/ That install created tree: H:\proc\tools\Gtk+\ which includes these: H:\proc\tools\Gtk+\include\libglade-2.0\ and H:\proc\tools\Gtk+\glade-3.exe H:\proc\tools\Gtk+\bin\libglade-2.0-0.dll H:\proc\tools\Gtk+\lib\libglade-2.0.a H:\proc\tools\Gtk+\lib\pkgconfig\libglade-2.0.pc So, I'm thinking maybe my install of Gtk+ (just running glade3-3.6.7-with-GTK+.exe) was lacking somehow, or cabal somehow doesn't see my Gtk+ dir (during "cabal install glade") ? So, I tried editing my cabal config so it would see my Gtk+ tree. I uncommented and edited these lines in the main, un-indented section: extra-include-dirs: H:\proc\tools\Gtk+\include extra-lib-dirs: H:\proc\tools\Gtk+\lib but it doesn't seem to help. (my full cabal config listing is below) Regarding my use of H: instead of C:, I have a non-standard configuration of the Haskell Platform and cabal. I need to develop (Haskell code that uses Gtk2Hs, Glade, etc.) in a MS Windows network, from any of several PCs (one at a time), each of which uses a common tools tree. So, instead of installing the Haskell Platform, cabal, Gtk+, etc. to C:, I have installed them to a network drive (H:). So, I have: H:\proc\tools\Haskell Platform H:\proc\tools\Gtk+ H:\proc\tools\cabal etc. Any help or pointers would be appreciated. Thanks very much, -- Peter --- Following is various config and output info --- My PATH is: ++++++++++++++ SET P_TOOLS=H:\proc\tools SET HASK_PLAT=%P_TOOLS%\Haskell Platform\2010.1.0.0 PATH %HASK_PLAT%\bin; %P_TOOLS%\cabal\bin; %P_TOOLS%\gtk\bin; %HASK_PLAT%\lib\extralibs\bin; %HASK_PLAT%\mingw\bin ++++++++++++++ Some of my environment vars are: ============== REM This is so Cabal will get its config from the Haskell Platform, REM rather than C:\Documents and Settings\pschmitz\Application Data\cabal SET CABAL_CONFIG=%P_TOOLS%\cabal\config CABAL_CONFIG=H:\proc\tools\cabal\config PKG_CONFIG_PATH=H:\proc\tools\Gtk+\lib\pkgconfig GTK_HOME=\\fbpxfile01\users$\pschmitz\proc\tools\Gtk+ HASK_PLAT=H:\proc\tools\Haskell Platform\2010.1.0.0 INCLUDE=\\fbpxfile01\users$\pschmitz\proc\tools\Gtk+\include LIB=\\fbpxfile01\users$\pschmitz\proc\tools\Gtk+\lib Path=H:\proc\tools\Haskell Platform\2010.1.0.0\bin;H:\proc\tools\cabal\bin;H:\proc\tools\Gtk+\bin; H:\proc\tools\Haskell Platform\2010.1.0.0\lib\extralibs\bin;H:\proc\tools\Haskell Platform\2010.1. 0.0\mingw\bin; ============== The full output from "cabal install glade" is: ----------------------------- H:\proc\dev\cmd>cabal --version cabal-install version 0.8.2 using version 1.8.0.2 of the Cabal library H:\proc\dev\cmd>cabal list glade * glade Synopsis: Binding to the glade library. Latest version available: 0.11.1 Latest version installed: [ Not installed ] Homepage: http://www.haskell.org/gtk2hs/ License: LGPL-2.1 ... H:\proc\dev\cmd>cabal info glade * glade (library) Synopsis: Binding to the glade library. Latest version available: 0.11.1 Latest version installed: [ Not installed ] Homepage: http://www.haskell.org/gtk2hs/ Bug reports: http://hackage.haskell.org/trac/gtk2hs/ Description: This library allows to load externally stored user interfaces into programs. This allows alteration of the interface without recompilation of the program. Category: Graphics License: LGPL-2.1 Author: Manuel M T Chakravarty Maintainer: gtk2hs-users@sourceforge.net Source repo: http://code.haskell.org/glade/ Dependencies: base >=4 && <5, array -any, containers -any, haskell98 -any, mtl -any, glib >=0.11 && <0.12, pango >=0.11 && <0.12, cairo >=0.11 && <0.12, gtk >=0.11 && <0.12 Cached: Yes Modules: Graphics.UI.Gtk.Glade H:\proc\dev\cmd>cabal install glade Resolving dependencies... C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.13100\glade-0.11.1\Gtk2HsSetup.hs:25: warning: #warning Setup.hs is guessing the version of Cabal. If compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) [1 of 2] Compiling Gtk2HsSetup ( C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.13100\glade-0.11.1\Gtk2HsSetup.hs, C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.13100\glade-0.11.1\dist\setup\Gtk2HsSetup.o ) [2 of 2] Compiling Main ( C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.13100\glade-0.11.1\Setup.hs, C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.13100\glade-0.11.1\dist\setup\Main.o ) Linking C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.13100\glade-0.11.1\dist\setup\setup.exe ... Configuring glade-0.11.1... setup.exe: The pkg-config package libglade-2.0 version >=2.0.0 is required but it could not be found. cabal: Error: some packages failed to install: glade-0.11.1 failed during the configure step. The exception was: ExitFailure 1 ----------------------------- My complete Cabal config follows. The email may alter the indentation, but I was careful to maintain the original indentation when editing. -- ---------------------------------------------------------------------------------------------- -- This is the configuration file for the 'cabal' command line tool. -- The available configuration options are listed below. -- Some of them have default values listed. -- Lines (like this one) beginning with '--' are comments. -- Be careful with spaces and indentation because they are -- used to indicate layout for nested sections. remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive remote-repo-cache: H:\proc\tools\cabal\packages -- local-repo: -- verbose: 1 -- compiler: ghc -- with-compiler: -- with-hc-pkg: -- scratchdir: -- program-prefix: -- program-suffix: -- library-vanilla: True -- library-profiling: False -- shared: False -- executable-profiling: False -- optimization: True -- library-for-ghci: True -- split-objs: False -- executable-stripping: True -- user-install: True -- package-db: -- flags: -- -- -------------------------------- -- extra-include-dirs: -- extra-lib-dirs: extra-include-dirs: H:\proc\tools\Gtk+\include extra-lib-dirs: H:\proc\tools\Gtk+\lib -- -------------------------------- -- -- constraint: -- cabal-lib-version: -- preference: -- documentation: False -- doc-index-file: $datadir\doc\index.html -- root-cmd: -- symlink-bindir: build-summary: H:\proc\tools\cabal\logs\build.log -- build-log: remote-build-reporting: anonymous -- username: -- password: install-dirs user prefix: "H:\\proc\\tools\\cabal" -- bindir: $prefix\bin -- libdir: $prefix -- libsubdir: $pkgid\$compiler -- libexecdir: $prefix\$pkgid datadir: "H:\\proc\\tools\\Haskell Platform\\2010.1.0.0" -- datasubdir: $pkgid -- docdir: $prefix\doc\$pkgid -- htmldir: $docdir\html -- haddockdir: $htmldir install-dirs global prefix: "H:\\proc\\tools\\Haskell Platform\\2010.1.0.0" -- bindir: $prefix\bin -- libdir: $prefix -- libsubdir: $pkgid\$compiler -- libexecdir: $prefix\$pkgid datadir: "H:\\proc\\tools\\Haskell Platform\\2010.1.0.0" -- datasubdir: $pkgid -- docdir: $prefix\doc\$pkgid -- htmldir: $docdir\html -- haddockdir: $htmldir -- ---------------------------------------------------------------------------------------------- -- end of post: Trying to compile Glade Gtk2Hs demo / cabal install glade problem --

Thanks so very much Axel and Ivan. You were both absolutely correct and I can compile Glade apps now fine. Great help! The tricky part (for me) would have been looking at the error from cabal install glade: "setup.exe: The pkg-config package libglade-2.0 version >=2.0.0 is required but it could not be found." and determining that the problem was that libglade-2.0.pc needed the edit you described, but I made the edit and it all works now. -- Peter And I guess I don't need these edits to cabal/config after all: -- -------------------------------- -- extra-include-dirs: -- extra-lib-dirs: extra-include-dirs: H:\proc\tools\Gtk+\include extra-lib-dirs: H:\proc\tools\Gtk+\lib -- -------------------------------- New "cabal install glade" after libglade-2.0.pc edit: H:\proc\dev\cmd>pkg-config --modversion libglade-2.0 2.6.4 H:\proc\dev\cmd>cabal install glade Resolving dependencies... C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.12236\glade-0.11.1\Gtk2HsSetup.hs:25: warning: #warning Setup.hs is guessing the version of Cabal. If compilation of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when building (prefixed by --ghc-option= when using the 'cabal' command) [1 of 2] Compiling Gtk2HsSetup ( C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.12236\glade-0.11.1\Gtk2HsSetup.hs, C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.12236\glade-0.11.1\dist\setup\Gtk2HsSetup.o ) [2 of 2] Compiling Main ( C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.12236\glade-0.11.1\Setup.hs, C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.12236\glade-0.11.1\dist\setup\Main.o ) Linking C:\DOCUME~1\pschmitz\LOCALS~1\Temp\glade-0.11.12236\glade-0.11.1\dist\setup\setup.exe ... Configuring glade-0.11.1... Preprocessing library glade-0.11.1... Building glade-0.11.1... [1 of 2] Compiling Graphics.UI.Gtk.Glade.Types ( dist\build\Graphics\UI\Gtk\Glade\Types.hs, dist\build\Graphics\UI\Gtk\Glade\Types.o ) [2 of 2] Compiling Graphics.UI.Gtk.Glade ( dist\build\Graphics\UI\Gtk\Glade.hs, dist\build\Graphics\UI\Gtk\Glade.o ) Registering glade-0.11.1... Installing library in H:\proc\tools\cabal\glade-0.11.1\ghc-6.12.1 Registering glade-0.11.1... H:\proc\dev\cmd>

Thanks so very much Axel and Ivan. You were both absolutely correct and I can compile Glade apps now fine. Great help! That's sounds very promising. Lucky you! Would you share the information with the list - at least I'm really interested in how getting exactly
Hello, I'm searching for information on a solution that must have been found earlier on the list and somehow must have got lost, but have a look now please... On 14.08.2010 00:47, Peter Schmitz wrote: this done.
The tricky part (for me) would have been looking at the error from cabal install glade: "setup.exe: The pkg-config package libglade-2.0 version >=2.0.0 is required but it could not be found." and determining that the problem was that libglade-2.0.pc needed the edit you described, but I made the edit and it all works now.
-- Peter ... New "cabal install glade" after libglade-2.0.pc edit: Would you share information about that?? See my comment above...
Thanks for reading Daniel

Hi list again, I'm happy to tell you the solution at least to my install problem: ??? is synonym for D:/Programme/Gtk+ on my example setup. Download glade3-3.6.7-with-GTK+.exe (http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/3.6/glade3-3.6.7-with-G...) Install. Download libxml2_2.7.7-1_win32.zip and libxml2-dev_2.7.7-1_win32.zip (http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libxml2_2.7.7-1_w... http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/libxml2-dev_2.7.7...): Install and you get libxml-2.0.pc (in ???/lib/pkgconfig). My PKG_CONFIG_PATH variables first entry is D:/Programme/Gtk+/lib/pkgconfig (note forward slash char.), to prefer new copied libxml2 files over others I had. Using bash... $ echo $PATH /bin:/sbin:/usr/bin:/usr/sbin:/etc:/usr/local/bin:/usr/bin/X11:/h/gvimportable:/d/Programme/Gtk+/bin:/c/Users/daniel/Appdata/Roaming/cabal/bin:/c/PROGRA~2/HASKEL~1/201020~1.0/lib/extralibs/bin:/c/PROGRA~2/HASKEL~1/201020~1.0/bin:/c/PROGRA~2/HASKEL~1/201020~1.0/mingw/bin:/h/MinGW32/bin Nothing more needed for sucessful cabal install, assuming gtk2hs installation succeeded as happened. Pitfall was: Most likely a wrong libxml version taken from those other pkgconfig places I had. Cool, now I can install threadscope and do learn effects of different parallelisation strategies as pointed out in those nice papers. Cheers Daniel On 10.09.2010 20:00, Daniel Kahlenberg wrote:
Great help! That's sounds very promising. Lucky you! Would you share the information with the list - at least I'm really interested in how getting exactly this done. New "cabal install glade" after libglade-2.0.pc edit: Would you share information about that?? See my comment above...
Thanks for reading Daniel
participants (2)
-
Daniel Kahlenberg
-
Peter Schmitz