Hi Miguel,
I have attached a new version of the Gtk# compilation instructions.
Unfortunately I am not a native speaker but I hope my English is at
least good enough to be understood :-) . I verfied them again from the
beginning to make sure they actually work.
Of course I would volunteer to upload this article and to keep the Wiki
information up to date. If you want me to do so you'd have to create me
an account for the Wiki as I currently don't have access to it.
Otherwise you can also upload them yourself.
You might have noticed that I finally got the installer work done and
created a Gtk# 2.12 installer based on the one provided by Medsphere. I
have also sent them a patch to update their installer to 2.12, but it
didn't appear on their homepage yet. I think we should also host it on
the Mono site, but we should ask them for permission at first. I'll deal
with that and write you a mail when the situation is clear.
The update of the Mono Windows installer(which still ships with Gtk#
2.10.4) will have to wait for another two weeks or so(there's now a lot
of work to be done in my own application), but I promise to get back to
it as soon as possible. Do you know who is maintaining it?
Christian
Miguel de Icaza schrieb:
Hello Christian,
First of all, thank you a lot for posting this update about Gtk# on
Windows, this is a very painful issue for me, as for some reason we have
been absolutely unable to provide a Gtk# 2.12 natively for .NET.
So far, the great guys at Medsphere have been doing the work in
supporting Gtk# for .NET, while we supported it for Mono on Windows, but
while we support 2.12, they only were up to 2.10, so your post is very
timely.
Getting Gtk# to work took me about 7 full-time days mainly because of
the broken gapi-cdecl-insert script(see
https://bugzilla.novell.com/show_bug.cgi?id=417615) and the deprecated
documentation here:
http://www.mono-project.com/Compiling_Mono#Building_GTK.23. It points to
old Gtk versions, is much more complicated than the solution I found,
does not mention that you have to install some Mono assemblies into the
MS GAC(Mono.Cairo, etc.) and also does not explain building Gtk# for
Mono(it only says how to build it for the MS GAC and the Mono build is a
little more complicated).
Would you mind telling me what is wrong on the Wiki, or perhaps
would you mind making the changes to the Wiki yourself to have the
information up-to-date for Windows people?
Mike, if I sent you an updated version of the Doku, could you upload it
to the Mono Wiki?
I can, and would love to do it.
Again, I would be great if someone could help me with the installer so
that we soon have a 2.12 version of Gtk# for Windows :-)
Christian
_______________________________________________
Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
Building GTK#
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.
_______________________________________________
Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list