Install GTK on Windows

Hi, cafe, I know this has been treated many times, but I've tried install GTK so hard without any success that I decided to ask for help. Firstly, I followed the instructions listed in HaskellWiki [1]. No results. Then, I followed the instruction from the Mark Shroyer blog [2]. No results. I did some mixing of the two guides, too, but my error was always the same: Configuring cairo-0.12.0... [...] setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: z, cairo Configuring glib-0.12.0... [...] setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: gobject-2.0, gthread-2.0, glib-2.0, intl I've searched for these libraries, and, with --extra-include-dirs=, I've included them. But the same error was thrown. I'm sure I'm doing something wrong or, perhaps, I'm missing something. Any help is welcomed! Thanks in advance, Daniel Díaz References: [1] http://www.haskell.org/haskellwiki/Gtk2Hs [2] http://markshroyer.com/2010/10/gtk2hs-on-windows/

Hi Daniel, Gtk2hs site is down by move server, sadly. The document on http://www.haskell.org/haskellwiki/Gtk2Hs is wrong. http://markshroyer.com/2010/10/gtk2hs-on-windows/ is right.
From your error, you missing C libraries that gtk2hs need, or you have install GTK+ C library, but gtk2hs can't find those libraries somehow (such as wrong configure ...)
The right way is :
1) Install GTK+ all-in-one bundle (Include C library)
2) Very import, add GTK+ C library and Cabal bin path add in environment variable PATH
3) Then do "cabal update && cabal install gtk2hs-buildtools && cabal install gtk"
I'm not Windows guy, but almost like above.
I will find time re-build gtk2hs site and
provide Windows Installer (But i can't promise when, i'm so busy)
Hope above will help you. :)
-- Andy
Daniel Díaz
Hi, cafe,
I know this has been treated many times, but I've tried install GTK so hard without any success that I decided to ask for help.
Firstly, I followed the instructions listed in HaskellWiki [1]. No results.
Then, I followed the instruction from the Mark Shroyer blog [2]. No results.
I did some mixing of the two guides, too, but my error was always the same:
Configuring cairo-0.12.0... [...] setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: z, cairo
Configuring glib-0.12.0... [...] setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: gobject-2.0, gthread-2.0, glib-2.0, intl
I've searched for these libraries, and, with --extra-include-dirs=, I've included them. But the same error was thrown.
I'm sure I'm doing something wrong or, perhaps, I'm missing something.
Any help is welcomed!
Thanks in advance, Daniel Díaz
References:
[1] http://www.haskell.org/haskellwiki/Gtk2Hs [2] http://markshroyer.com/2010/10/gtk2hs-on-windows/

Thanks for the responses, but my error remains. I wrote two scripts, following both different instructions. Script 1: @echo off title GTK Haskell Setup echo * Add GTK bin folder. set PATH=%PATH%;C:\Documents and Settings\User\Escritorio\GTK\GTKAIO\bin echo * Add GTK include folder. set PATH=%PATH%;C:\Documents and Settings\User\Escritorio\GTK\GTKAIO\include echo * Add GTK lib folder. set PATH=%PATH%;C:\Documents and Settings\User\Escritorio\GTK\GTKAIO\lib echo * Add Cabal bin folder. set PATH=%PATH%;C:\Documents and Settings\User\Datos de programa\cabal\bin echo * Add mingw folder. set PATH=%PATH%;C:\Archivos de programa\Haskell Platform\2010.2.0.0\mingw\bin echo * Value of PATH. echo %PATH% echo * Install GTK buildtools. cabal install gtk2hs-buildtools echo * Install GTK. cabal install gtk Script 2: @echo off title GTK Haskell Setup echo * Add pkgconfig directory for libxml. set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%;C:\Documents and Settings\User\Escritorio\GTK\libmxl2\libxml2-dev_2.7.7-1_win32\lib\pkgconfig echo * Add include directory for libxml. set INCLUDE=%INCLUDE%;C:\Documents and Settings\User\Escritorio\GTK\libmxl2\libxml2-dev_2.7.7-1_win32\include echo * Add pkgconfig directory for GTK. set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%;C:\Documents and Settings\User\Escritorio\GTK\Gtk+\lib\pkgconfig echo * Add libglade directory. set INCLUDE=%INCLUDE%;C:\Documents and Settings\User\Escritorio\GTK\Gtk+\include\libglade-2.0 echo * Value of PATH. echo %PATH% echo * Value of INCLUDE echo %INCLUDE% echo * Value of PKG_CONFIG_PATH echo %PKG_CONFIG_PATH% echo * Install GTK buildtools. cabal install gtk2hs-buildtools echo * Install GTK. cabal install gtk In the script 1, GTKAIO is the folder where I installed the GTK All In One. Apparently, I followed your instructions. Otherwise, what's wrong?

In my experience cross platform tools do not work in the presence of spaces
in paths. Because of this when on Windows I have the habit of putting any
cross platform libraries or tools in a non-spaced path. Another option
could be to use the short path names when setting the PATH. GHC and cabal
do not appear to have this problem (fortunately).
Ryan
On Fri, Feb 25, 2011 at 4:20 PM, Daniel Díaz
Thanks for the responses, but my error remains.
I wrote two scripts, following both different instructions.
Script 1:
@echo off title GTK Haskell Setup echo * Add GTK bin folder. set PATH=%PATH%;C:\Documents and Settings\User\Escritorio\GTK\GTKAIO\bin echo * Add GTK include folder. set PATH=%PATH%;C:\Documents and Settings\User\Escritorio\GTK\GTKAIO\include echo * Add GTK lib folder. set PATH=%PATH%;C:\Documents and Settings\User\Escritorio\GTK\GTKAIO\lib echo * Add Cabal bin folder. set PATH=%PATH%;C:\Documents and Settings\User\Datos de programa\cabal\bin echo * Add mingw folder. set PATH=%PATH%;C:\Archivos de programa\Haskell Platform\2010.2.0.0\mingw\bin echo * Value of PATH. echo %PATH% echo * Install GTK buildtools. cabal install gtk2hs-buildtools echo * Install GTK. cabal install gtk
Script 2:
@echo off title GTK Haskell Setup echo * Add pkgconfig directory for libxml. set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%;C:\Documents and
Settings\User\Escritorio\GTK\libmxl2\libxml2-dev_2.7.7-1_win32\lib\pkgconfig echo * Add include directory for libxml. set INCLUDE=%INCLUDE%;C:\Documents and Settings\User\Escritorio\GTK\libmxl2\libxml2-dev_2.7.7-1_win32\include echo * Add pkgconfig directory for GTK. set PKG_CONFIG_PATH=%PKG_CONFIG_PATH%;C:\Documents and Settings\User\Escritorio\GTK\Gtk+\lib\pkgconfig echo * Add libglade directory. set INCLUDE=%INCLUDE%;C:\Documents and Settings\User\Escritorio\GTK\Gtk+\include\libglade-2.0 echo * Value of PATH. echo %PATH% echo * Value of INCLUDE echo %INCLUDE% echo * Value of PKG_CONFIG_PATH echo %PKG_CONFIG_PATH% echo * Install GTK buildtools. cabal install gtk2hs-buildtools echo * Install GTK. cabal install gtk
In the script 1, GTKAIO is the folder where I installed the GTK All In One.
Apparently, I followed your instructions. Otherwise, what's wrong?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

El Vie, 25 de Febrero de 2011, 10:38 pm, Ryan Yates escribió:
In my experience cross platform tools do not work in the presence of spaces in paths. Because of this when on Windows I have the habit of putting any cross platform libraries or tools in a non-spaced path. Another option could be to use the short path names when setting the PATH. GHC and cabal do not appear to have this problem (fortunately).
Ryan
Spaces are not a problem for me. I can, for example, run the gtk-demo without problems. I avoid, when it's possible, to write spaces in my folder and file names, but I think the problem here is another. Anyway, I will test it. -- Daniel Díaz

Hi all, I'd just like to add that I succeeded in building gtk2hs in Windows XP 64bit with GHC 7.0.2, using the 2.16 bundle from [1] and following the instructions in [2]. However, running the test program of [2] still fails at runtime with "The procedure entry point g_assertion_message_expr could not be located in the dynamic link library libglib-2.0.0.dll". Any idea what could cause this? Do I need to add -l something when compiling the program? Thanks, Pedro [1] http://www.gtk.org/download-windows.html [2] http://markshroyer.com/2010/10/gtk2hs-on-windows/

Hi Pedro,
Perhaps the libglib-2.0.0.dll that is getting loaded is not the one you
want. You should be able to use a tool like process explorer [1] to see
which specific dlls are getting loaded when you run.
Ryan
[1] http://technet.microsoft.com/en-us/sysinternals/bb896653
2011/3/15 José Pedro Magalhães
Hi all,
I'd just like to add that I succeeded in building gtk2hs in Windows XP 64bit with GHC 7.0.2, using the 2.16 bundle from [1] and following the instructions in [2].
However, running the test program of [2] still fails at runtime with "The procedure entry point g_assertion_message_expr could not be located in the dynamic link library libglib-2.0.0.dll". Any idea what could cause this? Do I need to add -l something when compiling the program?
Thanks, Pedro

Thanks, that worked! First it was loading stuff from graphviz, and then from
sysWOW64... now I finally run threadscope :-)
Cheers,
Pedro
2011/3/15 Ryan Yates
Hi Pedro,
Perhaps the libglib-2.0.0.dll that is getting loaded is not the one you want. You should be able to use a tool like process explorer [1] to see which specific dlls are getting loaded when you run.
Ryan
[1] http://technet.microsoft.com/en-us/sysinternals/bb896653
2011/3/15 José Pedro Magalhães
Hi all,
I'd just like to add that I succeeded in building gtk2hs in Windows XP 64bit with GHC 7.0.2, using the 2.16 bundle from [1] and following the instructions in [2].
However, running the test program of [2] still fails at runtime with "The procedure entry point g_assertion_message_expr could not be located in the dynamic link library libglib-2.0.0.dll". Any idea what could cause this? Do I need to add -l something when compiling the program?
Thanks, Pedro

Hi Daniel,
What is the value of PATH, PKG_CONFIG_PATH and INCLUDE in the shell
from which you are invoking "cabal install ..."?
-deech
On Fri, Feb 25, 2011 at 6:40 AM, Daniel Díaz
Hi, cafe,
I know this has been treated many times, but I've tried install GTK so hard without any success that I decided to ask for help.
Firstly, I followed the instructions listed in HaskellWiki [1]. No results.
Then, I followed the instruction from the Mark Shroyer blog [2]. No results.
I did some mixing of the two guides, too, but my error was always the same:
Configuring cairo-0.12.0... [...] setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: z, cairo
Configuring glib-0.12.0... [...] setup.exe: Missing dependencies on foreign libraries: * Missing C libraries: gobject-2.0, gthread-2.0, glib-2.0, intl
I've searched for these libraries, and, with --extra-include-dirs=, I've included them. But the same error was thrown.
I'm sure I'm doing something wrong or, perhaps, I'm missing something.
Any help is welcomed!
Thanks in advance, Daniel Díaz
References:
[1] http://www.haskell.org/haskellwiki/Gtk2Hs [2] http://markshroyer.com/2010/10/gtk2hs-on-windows/
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

El Vie, 25 de Febrero de 2011, 2:34 pm, aditya siram escribió:
Hi Daniel, What is the value of PATH, PKG_CONFIG_PATH and INCLUDE in the shell from which you are invoking "cabal install ..."? -deech
PATH: C:\Archivos de programa\Haskell\bin C:\Archivos de programa\Haskell Platform\2010.2.0.0\lib\extralibs\bin C:\Archivos de programa\Haskell Platform\2010.2.0.0\bin [...] C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS\System32\Wbem [...] C:\gtk\bin C:\Documents and Settings\User\Datos de programa\cabal\bin C:\Archivos de programa\Haskell\bin C:\ghc\ghc-6.10.1\bin C:\Documents and Settings\User\Escritorio\GTK\gtk+-bundle_2.16.6-20100912_win32\bin C:\Archivos de programa\Haskell Platform\2010.2.0.0\mingw\bin PKG_CONFIG_PATH and INCLUDE are empty now. Following the Mark Shroyer's guide, these variables are not mentioned. -- Daniel Díaz

Maybe it's erroring out because you have C:\gtk\bin and C:\Documents
...\gtk+bundle...\bin in the same path. You shouldn't need both. I
also don't see any path that mentions the libxml libraries which you
will eventually need.
When I installed GTK on Windows 7 I also followed the blog post you
mention but found that the instructions didn't totally work for me
completely. That is why I documented my experiences on the Wiki. So
IMHO you do need INCLUDE and PKG_CONFIG_PATH.
That said I wrote those instructions based on *one* install so they
might well be wrong. I know it's confusing having two sets of
conflicting instructions but I suggest you follow one to completion,
and if it doesn't work, back out the conflicting changes and follow
the other.
-deech
On Fri, Feb 25, 2011 at 7:53 AM, Daniel Díaz
El Vie, 25 de Febrero de 2011, 2:34 pm, aditya siram escribió:
Hi Daniel, What is the value of PATH, PKG_CONFIG_PATH and INCLUDE in the shell from which you are invoking "cabal install ..."? -deech
PATH: C:\Archivos de programa\Haskell\bin C:\Archivos de programa\Haskell Platform\2010.2.0.0\lib\extralibs\bin C:\Archivos de programa\Haskell Platform\2010.2.0.0\bin [...] C:\WINDOWS\system32 C:\WINDOWS C:\WINDOWS\System32\Wbem [...] C:\gtk\bin C:\Documents and Settings\User\Datos de programa\cabal\bin C:\Archivos de programa\Haskell\bin C:\ghc\ghc-6.10.1\bin C:\Documents and Settings\User\Escritorio\GTK\gtk+-bundle_2.16.6-20100912_win32\bin C:\Archivos de programa\Haskell Platform\2010.2.0.0\mingw\bin
PKG_CONFIG_PATH and INCLUDE are empty now. Following the Mark Shroyer's guide, these variables are not mentioned.
-- Daniel Díaz

I have installed successfully the gtk package on Windows. GTK version: 2.16 gtk package version: 0.12.0 Haskell Platform version: 2010.2.0.0 I have detailed my steps (very similar to Mark Shroyer steps) here: http://deltadiaz.blogspot.com/2011/03/on-windows-how-to-install-gtk.html It seems that my error comes from an space in the path of gtk, and later, from my version of the Haskell Platform (cabal version, I guess). In brief: 1) Install Haskell Platform, version 2010.2.0.0. 2) Download and unpack gtk all-in-one bundle, version 2.16. Path without spaces. 3) Add gtk/bin and mingw/bin to the PATH environment variable. 4) Install gtk2hs-buildtools. 5) Install gtk. And it works!

Daniel Díaz
I have installed successfully the gtk package on Windows.
GTK version: 2.16 gtk package version: 0.12.0 Haskell Platform version: 2010.2.0.0
I have detailed my steps (very similar to Mark Shroyer steps) here:
http://deltadiaz.blogspot.com/2011/03/on-windows-how-to-install-gtk.html
It seems that my error comes from an space in the path of gtk, and later, from my version of the Haskell Platform (cabal version, I guess).
In brief: 1) Install Haskell Platform, version 2010.2.0.0. 2) Download and unpack gtk all-in-one bundle, version 2.16. Path without spaces. 3) Add gtk/bin and mingw/bin to the PATH environment variable. 4) Install gtk2hs-buildtools. 5) Install gtk.
And it works! Great! :)
-- Andy
participants (5)
-
aditya siram
-
Andy Stewart
-
Daniel Díaz
-
José Pedro Magalhães
-
Ryan Yates