working version of GTK for win64

 Hello all,

 I've tried to build and run gtk for 64-bit Windows. At last I can upload 
working version for usage:

 As usual devel file contains executable and development files, src file - 
complete development tree.

 For build I've use cross-compile mode for mingw compiler:

with CFLAGS="-s -O2 -mms-bitfields".

 One can build gtk applications using the same compiler or prepare MS Visual 
Studio 2008 libraries from above with "lib.exe /MACHINE:x64 /DEF:file.def". 
Both methods are working.

 According to my experience of porting I suggest the following patch in source 
code of gtk and related libraries:

 1) for all files in all packages glib, atk, cairo, pango, gtk in 
function func_win32_libid () replace string

$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then


$EGREP -e 'file format pe-(.*architecture: i386)?' >/dev/null ; then

  It allows libtool to recognize 64-bit dll files as shared libraries. Of 
course win32 version also works with this perfectly.

 2) use the following main types definitions:

#define GLIB_SIZEOF_LONG   4

and in glib/gmain.h for polling:

struct _GPollFD
#ifdef G_OS_WIN32
  void*         fd;
  gint          fd;
  gushort       events;
  gushort       revents;

 3) for all Windows API calls in gtk/gdk/win32 use new declarations:
SetWindowLongPtr instead of SetWindowLong, GWLP_HWNDPARENT for

 4) remove or disable c++ example (namely in gtk/tests.

 In the development tree all my changes have copies of original files with 
extentions .orig. Applications with 64-bit are tested on Windows Compute 
Cluster Server 2003 (wccs). The same code is running successfully for win32 
and wine with mingw for win32.

 If someone are interested in this version of code I can add same extra 
descriptions or details. From my point of view it will be very useful to 
incorporate code changes or some cleanups which work with win32 and win64 
versions of gtk and we'll continue to use gtk libraries in more areas and 

 Thanks in advance!

 Oleg Tchij,
 Head of High Performance Laboratory,
 UIIP NASB, Surganova 6,
 Minsk, Belarus


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]