gtkmm on Microsoft Windows

Download

There are Installers available for gtkmm on Microsoft Windows.

Installer Descriptions

gtkmm-win32-runtime-*.exe contains dynamic libraries (DLLs) of gtkmm, libxml++ and libglademm and all their dependencies. You need this to run programs using gtkmm if those programs don't distribute gtkmm themselves.

gtkmm-win32-devel-*.exe contains the same as the runtime package, plus header files, import libraries and documentation. You need this to compile applications or libraries that use gtkmm on Windows, with either MinGW or MSVC++. If you install this package, then you don't need the runtime one.

Using the Installers

To use the runtime environment, simply execute the installer and make sure the "Add the gtkmm runtime directory to the PATH variable" option is checked. This is required for Windows to find the gtkmm DLL files. If you know what you do, then you can also uncheck that option. This can be useful if you have multiple versions of gtkmm installed (for example, both runtime and development DLLs) and want to choose which one to use by setting the PATH variable manually. After installing, you are able to run programs using gtkmm.

To use the development environment, you need to know with which compiler you want to compile your application. MinGW and Visual C++ 2005 (or later) are supported. Older versions of Visual C++ are not supported, and are not likely to work.

Both packages contain the GTK+ runtime and its dependencies, and the development package also contains GTK+ header files, import libraries and documentation. You don't need to install anything else to use the packages.

All DLLs are installed into the bin/ subfolder in the installation directory.

MinGW DLLs

The DLLs prefixed with lib, such as libgtkmm-2.4-1.dll, are required if you build your application with MinGW.

The MinGW DLLs were built with g++ version 3.4.5. It is not guaranteed that other versions of g++ will work with the built binaries. Especially, we experienced the problem that exceptions thrown by glibmm or gtkmm could not be caught in applications built with g++ 3.4.2, which is shipped with Dev-C++ by default.

MSVC++ DLLs

The DLLs without a lib prefix, such as gtkmm-2.4.dll are MSVC++ DLLs. The DLLs without a d suffix are required for the Release configuration if you build your application with MSVC++. The DLLs with a d suffix, such as gtkmm-2.4d.dll, are MSVC++ debug DLLs. These are required for the Debug configuration of MSVC++-built applications.

The MSVC++ DLLs were built with Visual C++ 2005 and are linked to the MS C/C++ runtime DLLs: MSVCR80.DLL / MSVCP80.DLL.

GTK+ DLLs

For GTK+ and its dependencies (these are most DLLs that do not end on *mm, except libsigc-2.0.dll and xml++-2.6.dll) the convention mentioned above is not valid. There is only one DLL for each library, but this one works with both MinGW and MSVC++ (both Debug and Release Target), because they are C libraries, not C++.

Using MinGW

To build your application with MinGW, we recommend that you use the MSYS shell. With MSYS, you can compile your program as on Unix, for example via g++ foo.cc -o foo `pkg-config --cflags --libs gtkmm-2.4`.

You could also use the normal Windows command line to do this, but the backticks syntax would not work, so you would need to run pkg-config separately and insert the correct flags by hand.

The installer only provides native Windows DLLs, not Cygwin DLLs. Instructions on how to build native gtkmm Windows applications using cygwin would be welcome.

Using MSVC++ (Microsoft Visual Studio)

To build your application with MSVC++, open the "Property manager" via "View / Property Manager" in the menu, then right click the debug target, select "Add existing property sheet", then navigate to the location to which you installed gtkmm, descend into the MSVC directory and choose the gtkmm-2.4d.vsprops file. Then, do the same for the release target, but choose gtkmm-2.4.vsprops.

gtkmm-win32-msvc-propsheet.png

To prevent random crashes in the debug version, go to "Project / $MyProject properties" in the menu, make sure the Debug configuration is active (upper left corner of the dialog), then go to "Configuration Properties / C/C++ / Code generation" and choose "Multi-threaded Debug" as Runtime Library. This is because your application needs to be built against the same runtime library as the gtkmm (debug) DLLs.

gtkmm-win32-msvc-codegen.png

You might also want to change "Generate Debug Info" in "Linker / Debugging" to Yes to be able to debug your application. Both options don't seem to be default for the Debug configuration for new, empty projects. We don't know why.

gtkmm-win32-msvc-debuginfo.png

To work around a compiler bug in Visual Studio (http://bugzilla.gnome.org/show_bug.cgi?id=158040), the /vd2 flag needs to be passed to the compiler. This is already done automatically for your application if you use the property sheets as mentioned above. However, you need to remember to do this if you don't use the property sheets for some reason.

Updating

When new versions of the installers are released, you can simply execute the new installer to update your gtkmm installation. The installer will detect a previous version of gtkmm and uninstall it first.

Installer Side Effects

Apart from installing files and directories to the hard disk, the installer does the following:

For user-local installation, the registry keys are stored under HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE.

Silent Installs

For silent installations (installation without requiring user intervention, using the /S flag) the following options can be used:

Known problems

The Uninstaller will not remove Start Menu items.

Redistributing

For your application to work out of the box on other machines that don't have GTK+ or gtkmm installed you need to ship the following files with your application, perhaps using an installer. You should use the files from the runtime package, since they don't contain debug symbols. We suggest that you keep the directory structure of the installed files, so that GTK+ can correctly find its configuration files and modules.

This means that you'll have bin/, etc/, lib/ and share/ folders at the lop level of your package. Since all the DLLs are contained in bin/, this is were your application executable belongs as well. So it might end up in C:\Program Files\YourApplication\bin\YourApplication.exe on the target machine, depending on the installation directory. Most applications using GTK+ on Windows do this, such as GIMP.

Please do not install the DLL files into a global system path, such as C:\Windows\System32. Since GTK+ locates files it needs at runtime based on the path where the GTK+ DLL resides, you might also need to install other files, such as modules (image loaders, input modules, etc.) or theme settings into the same path. Also, if two different applications do this, then uninstalling one would need to make sure to keep the files in System32, so the other application does not break. Furthermore, the past has shown that new Glib or GTK+ versions on Windows are not always fully compatible with old ones, even though they try to be. This is improving, however.

gtkmm

You will need all these files for gtkmm:

GTK+ runtime

This is required by gtkmm, so you will need all these, too. A more detailed explanation of what all these libraries provide is available at the GTK+ for Windows page.

libxml++

If your program uses libxml++ then you will additionally need:

libglademm

If your program uses libglademm, then you will additionally need:

Rebuilding

To rebuild the gtkmm binaries or to recreate the installer, see the Building gtkmm on Windows.

gtkmm/MSWindows (last edited 2008-10-11 14:20:30 by ArminBurgmeier)