Gtk# Frequently Asked Questions
- General
-
- What is Gtk#?
- Why isn't it called Gnome# or
Gnome.Net?
- Compiling Gtk#
-
- What are the Dependencies to build Gtk# on X11
platforms?
- What about building on Win32
platforms?
- Developing with Gtk#
-
- Why can't mono find gtk-sharp.dll?
- Why can't my compiler find Gtk#
classes?
1.1 What is Gtk#?
Gtk# brings the power and ease of .Net development paradigms to the
free software GUI application development community. Gtk#
provides a C source parser and C# code generator which can be used
to produce .Net assemblies that bind to GObject based libraries.
Among the libraries currently wrapped are gtk, gdk, atk,
pango, gda, gnomedb, gconf, libgnomecanvas, libgnomeui, and
libglade.
1.2 Why isn't it called Gnome#
or Gnome.Net?
When the project was started, the idea was to wrap the Gtk+
libraries with a set of C# classes. It quickly became
apparent that the source parser and C# code generator could be used
to wrap any GObject based API. Contributors started wrapping
their favorite GNOME libraries. Mailing lists and a
sourceforge project were already open under the gtk-sharp
nomenclature and no compelling technical reasons for renaming
presented themselves. The decision was made to continue under
the Gtk# name, even though the binding encompasses more than just
Gtk, and more than just C#.
2.1 What are the Dependencies
to build Gtk# on X11 platforms?
You'll need a .Net framework installed. Gtk# has been successfully
used with both the mono and
Portable.Net
frameworks. The bare minimum requirement is a complete installation
of the Gtk+-2.0 libraries. Keep in mind that if your Gtk+
installation is provided by binary packages, you will also need to
install the *-devel packages. If you have additional
GNOME-2.0 libraries installed, the configure script will detect
their presence and the associated wrappers will be built. A
summary of the libraries which will be built is printed at the end
of the configure step.
2.2 What about building on
Win32 platforms?
To build Gtk# on win32, you will need a working
cygwin installation. Keep
in mind that the default cygwin installation may not have all the
tools you need. Cygwin provides the gnu make tool which
builds the Gtk# library. You will also need the mingw-gcc
compiler installed in order to build the Gtk# glue library.
There are binary packages of the Gtk+-2.0 libs and
dependencies available from the
Gtk+ for Win32
project page. You will also need these libraries
installed, along with their devel packages in order to build the
glue library. Once you have this environment set up, expand
the gtk-sharp source into a directory and in a Cygwin shell window,
cd to the gtk-sharp directory and execute the command "make -f
makefile.win32".
3.1 Why can't mono find
gtk-sharp.dll?
You most likely have installed Gtk# into a prefix other than where
mono is installed. In order for the runtime to locate the
Gtk# assemblies, you will need to add their location to the
MONO_PATH environment variable. For the default installation
prefix, this will mean executing the following command:
export MONO_PATH=/usr/local/lib:$MONO_PATH
3.2 Why can't my compiler find
the Gtk# classes?
You need to provide an assembly reference in your compilation
command. This will look like "mcs /ref:gtk-sharp foo.cs" if you are
referencing classes in the Gtk or GtkSharp namespaces.