[Gtk-sharp-list] Gtk# 2.12 for Windows

Miguel de Icaza miguel at ximian.com
Fri Aug 29 14:37:41 EDT 2008


hello Christian,

   Thanks for providing us with the updated Gtk# build instructions, I
have now updated the wiki page with it.   Thanks a lot!

   Maybe we need to distribute a few assemblies without Mono like
Mono.Cairo.

> Building GTK# 2 uses a similar process as building Mono. First, we'll
> need some more dependencies:
> 
> * Microsoft's .NET Framework and SDK(both v1.1!) from
> msdn.microsoft.com/downloads.
> 
> The MS .NET SDK is needed because the gtk-sharp2 build currently uses
> the disassembler(ildasm) from the MS SDK for a portion of the build.
> Eventually, the gtk-sharp2 build will use the tools from Mono, but
> currently this is how it's done. Make sure there are no spaces in the
> installation paths since the GTK# makefiles do not always quote the
> path to the executables.
> 
> You will also need to get Mono.Cairo(v1.0). Unfortunately the win32
> binaries are not available seperately; you can either install Mono for
> Windows or extract the file from Medsphere's Gtk# runtime
> installer(see link below, there are various utilities to extract files
> from a MSI-Package).
> 
> Next install Mono.Cairo into the MS GAC:
> gacutil /i PATH_TO_MONOCAIRO/Mono.Cairo.dll
> 
> Now the Gtk dependencies:
> 
> * Download the latest Gtk+ bundle from
> http://www.gtk.org/download-windows.html
> 
> If you want to build Glade#(optional):
> * iconv and libxml2 from http://xmlsoft.org/sources/win32/
> * libglade-bin and libglade-dev from the gladewin32 project:
> http://sourceforge.net/project/showfiles.php?group_id=98754
> 
> Extract these zip files to the same location by using Microsoft's
> xcopy or the very useful copy function in 7-zip which can also handle
> directory structures. Add the ZIP_FILES\bin directory to your
> path(Windows XP: control panel->System->Advanced->Environment
> variables->Path) and run gtk-demo.exe in the same directory to test
> your Gtk+ installation.
> 
> As we have to use the win32 pkg-config from the Gtk+ bundle(because
> has supports for dynamic disks such as C:/devel/target/... needed by
> the Gtk+ pkg-config files), create a symlink from your
> ZIP_FILES/share/aclocal/pkg.m4 file to /usr/share/aclocal/pkg.m4:
> ln
> -s /cygdrive/c/ZIP_FILES/share/aclocal/pkg.m4 /usr/share/aclocal/pkg.m4
> If the target already exists, uninstall the cygwin pkg-config package.
> 
> Make sure that Mono is not in the path, and put the MS tools in the
> path. Here's an example of how to do this from the cygwin bash shell:
> 
> CSC=`cygpath -d /cygdrive/c/WINDOWS/Microsoft.NET/Framework/v1.1.4322`
> CSC=`cygpath -a $CSC`
> 
> SDK=`cygpath -d "/cygdrive/c/Program
> Files/Microsoft.NET/SDK/v1.1/Bin"`
> SDK=`cygpath -a $SDK`
> export PATH=$SDK:$CSC:$PATH
> 
> Now we can start building. Unpack the gtk-sharp2 source and enter it's
> directory. Here are the commands to build:
> 
> # No idea why we need the four backslashes, probably missing/incorrect
> quotes in the Gtk# makefiles; the following has to be replaced ith the
> correct Windows path
> export MONO_CAIRO_LIBS="-r:C:\\\\Programme\\\\Mono\\\\lib\\\\mono\\\
> \1.0\\\\Mono.Cairo.dll"
> export MONO_CAIRO_CFLAGS=" "                                       #
> Seemingly useless, but otherwise pkg-config won't recognize our
> package
> export CC="gcc -mno-cygwin"                                        #
> Make sure we're not dependent on cygwin
> export PKG_CONFIG="/cygdrive/c/PATH_TO_ZIP_FILES/Bin/pkg-config"   #
> We have to use the win32 version of pkg-config from the Gtk+ bundle;
> do NOT use Cygwin's pkg-config
> ./configure --prefix=/tmp/install                                  #
> Choose any prefix you like, call bootstrap-2.12 instead when building
> SVN
> 
> make
> make install
> 
> Add the INSTALL_PREFIX\lib directory to your Windows(not Cygwin!) Path
> as well. The .NET dll's will be placed in the MS GAC. Enjoy!
> 
> 
> Other useful links:
> 
>     * Build Gtk# with Medsphere's Gtk# SDK
> (http://www.medsphere.org/projects/gtksharp/wiki/CompilingGtkSharpOnCygwin)
> 
>     * Kevin Shockey's very complete step by step article
> (http://www.ondotnet.com/pub/a/dotnet/2005/02/07/monowindows.html) on
> building Mono on Windows. 
> 
>     * Up to date glib
> (http://anonsvn.mono-project.com/viewcvs/*checkout*/trunk/release/packaging/defs/mono) and gtk (http://anonsvn.mono-project.com/viewcvs/*checkout*/trunk/release/packaging/defs/gtk-sharp) dependencies that are being used for the Mono Windows Combined Installer. 



More information about the Gtk-sharp-list mailing list