Discussion:
[Haskell-cafe] Install GTK on Windows
Daniel Díaz
2011-02-25 12:40:13 UTC
Permalink
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/
aditya siram
2011-02-25 13:34:15 UTC
Permalink
Hi Daniel,
What is the value of PATH, PKG_CONFIG_PATH and INCLUDE in the shell
from which you are invoking "cabal install ..."?
-deech
Post by 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.
Configuring cairo-0.12.0...
[...]
* Missing C libraries: z, cairo
Configuring glib-0.12.0...
[...]
* 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
[1] http://www.haskell.org/haskellwiki/Gtk2Hs
[2] http://markshroyer.com/2010/10/gtk2hs-on-windows/
_______________________________________________
Haskell-Cafe mailing list
http://www.haskell.org/mailman/listinfo/haskell-cafe
Daniel Díaz
2011-02-25 13:53:36 UTC
Permalink
Post by aditya siram
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
aditya siram
2011-02-25 14:37:10 UTC
Permalink
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
Post by Daniel Díaz
Post by aditya siram
Hi Daniel,
What is the value of PATH, PKG_CONFIG_PATH and INCLUDE in the shell
from which you are invoking "cabal install ..."?
-deech
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
Andy Stewart
2011-02-25 13:29:23 UTC
Permalink
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.
Daniel Díaz
2011-02-25 21:20:10 UTC
Permalink
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?
Ryan Yates
2011-02-25 21:38:56 UTC
Permalink
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
Post by Daniel Díaz
Thanks for the responses, but my error remains.
I wrote two scripts, following both different instructions.
@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
@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
http://www.haskell.org/mailman/listinfo/haskell-cafe
Daniel Díaz
2011-02-25 22:02:02 UTC
Permalink
Post by Ryan Yates
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
José Pedro Magalhães
2011-03-15 09:10:48 UTC
Permalink
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/
Ryan Yates
2011-03-15 13:49:41 UTC
Permalink
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
Post by 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
[1] http://www.gtk.org/download-windows.html
[2] http://markshroyer.com/2010/10/gtk2hs-on-windows/
José Pedro Magalhães
2011-03-16 07:25:00 UTC
Permalink
Thanks, that worked! First it was loading stuff from graphviz, and then from
sysWOW64... now I finally run threadscope :-)


Cheers,
Pedro
Post by 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
Post by 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
[1] http://www.gtk.org/download-windows.html
[2] http://markshroyer.com/2010/10/gtk2hs-on-windows/
Daniel Díaz
2011-03-22 17:11:09 UTC
Permalink
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!
Andy Stewart
2011-03-23 00:15:36 UTC
Permalink
Post by 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
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).
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

Loading...