GTK

From Open Watcom

Jump to: navigation, search

GTK+ project home page is here GTK+

The GTK published binary library can be linked with OpenWatcom user code.

Note: GTK+ is moving from version 2 to version 3. In attempting to report issues with building version 3 on Windows, I've found their support extremely negative and anything but helpful. I highly recommend using another GUI toolkit besides this one. Other options include wxWidgets, pdcurses, FLTK, Fox Toolkit, SDL. Other possibilites that may be worth investigating including qt, poco and ultimate++.

Download the runtime and theme package from here: GTK+ for Windows Runtime Environment

Note: This may still be available from the wayback machine or another resource of this nature, but the page is currently offline. If you must use GTK+, please see http://www.gtk.org/download/win32.php instead.

Normally it will be installed in "C:\Program Files\GTK2-Runtime\" After install go to bin directory of the GTK runtime "C:\Program Files\GTK2-Runtime\bin"

You must generate import libs for wlink using the OW Librarian, runing wlib on needed dll's like this:

these are used for most common examples sources

wlib -n -inn mygtk-win32-2.0-0.lib +libgtk-win32-2.0-0.dll

wlib -n -inn mygobject-2.0-0.lib +libgobject-2.0-0.dll

wlib -n -inn myglib-2.0-0.lib +libglib-2.0-0.dll

and for translations

wlib -n -inn myintl.lib +intl.dll

Download the dev packages from here: GTK+ individual packages

Unpack the dev packages on the local hard disk c:\gtk2 Then copy all of my*.lib into c:\gtk2\lib. Don't forget to add my*.lib to openwatcom project files.

In the OpenWatcom IDE Options->C++ Compiler Switches "Include directories [-i] add:

\gtk2\include \gtk2\include\gtk-2.0 \gtk2\lib\glib-2.0\include
\gtk2\include\glib-2.0\include \gtk2\include\glib-2.0  \gtk2\include
\cairo \gtk2\include\pango-1.0 \gtk2\lib\glib-2.0\include \gtk2\include
\glib-2.0\include  \gtk2\lib\gtk-2.0\include \gtk2\include\atk-1.0

The above applies to your current project and might be different for other projects.

As an alternative you can modify the INCLUDE environment variable, if you want to permanently include the GTK+ "include" files for OpenWatcom projects.

Start the WIN32 registry editor

Start->Run and enter regedit.

In registry you must modify INCLUDE from

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment

Multiple directories must be separated by ';' (semicolon)

In the OpenWatcom IDE Options->C++ Compiler Switches in "Memory model an processor switches->Target model" must be set to -6s (must match the library calling convention which is stack)

If you want to create deliverable applications for other people you must include in your install the GTK+ Runtime, needed for dll's used, or you can include only dll's used by the application in your installation kit.

Personal tools