2002 May 5
This is a tutorial on how to port a UNIX/GTK+ application to Win32, it is based on the information used by WolfPack Entertainment to port their own UNIX/GTK+ applications to Win32.
You will need the following in order to port your UNIX/GTK+ application to Win32 using this tutorial:
- The source for the application that you want to port
- VC++ installed and working properly on a Windows machine
Contents
- Installing GTK+ Win32 Devel on your Windows machine
- Set up VC++ to compile with GTK+ Win32 Devel
- GDKX and GDKWin32 Devel Set Up
- Project Set Up & Compiling
- Installing GTK+ Win32 DLLs on your Windows machine
- Common Errors & Solutions
Installing GTK+ Win32 Devel on your Windows machine
The files that you need to download are listed at:
The exact GTK+ Win32 Devel and GTK+ Win32 DLL package files that you need to download are as follows:- atk-1.0.0-20020314.zip
- atk-dev-1.0.0-20020314.zip
- dirent.zip
- glib-2.0.0-20020316.zip
- glib-dev-2.0.0-20020310.zip
- gtk+-2.0.0-20020310.zip
- gtk+-dev-2.0.0-20020314.zip
- libiconv-1.7.zip
- libiconv-dev-1.7.zip
- libintl-0.10.40-20020101.zip
- libjpeg-6b.zip
- libpng-1.2.0.zip
- libtiff-3.5.6-beta.zip
- pango-1.0-20020317.zip
- pango-dev-1.0-20020310.zip
- zlib-1.1.3.zip
Create a subdirectory in which you want to place your GTK+ Win32 Devel files in, on our Windows machine we used:
D:\GTKWIN32\
D:\GTKWIN32\BIN\D:\GTKWIN32\DOC\D:\GTKWIN32\ETC\D:\GTKWIN32\INCLUDE\D:\GTKWIN32\LIB\D:\GTKWIN32\MAN\D:\GTKWIN32\SHARE\
Move all the package files that you have just downloaded in to:
D:\GTKWIN32\
Note: The file COPYING.LIB-2 is common in most packages, you will be prompted to overwrite it when you extract (respond yes to that). Also, there is a duplicate file named lib\pkgconfig\libpng.pc found in both packages libpng-1.2.0.zip and zlib-1.1.3.zip (we used the one from zlib-1.1.3.zip since it was slightly newer).
[ Top of Section | Contents ]
Set up VC++ to compile with GTK+ Win32 Devel
D:\GTKWIN32\BIN\(For Executeable files)D:\GTKWIN32\INCLUDE\(For Include files)D:\GTKWIN32\INCLUDE\GLIB-2.0\D:\GTKWIN32\LIB\GLIB-2.0\INCLUDE\D:\GTKWIN32\LIB\GTK+\INCLUDE\D:\GTKWIN32\LIB\(For Library files)
[ Top of Section | Contents ]
GDKX and GDKWin32 Devel Set Up
#ifdef WIN32
# include
#else
# include
#endif
And install it in D:\GTKWIN32\INCLUDE\GDK\WIN32\GDKPRIVATE-WIN32.H [ Top of Section | Contents ]
Project Set Up & Compiling
Look for those inD:\GTKWIN32\LIB\ At this point you are ready to try and compile. There may be errors and there probably will be errors, if you do encounter errors please read the section Common Errors and Solutions
If you do manage to compile things successfully, do not run your program just yet. You will need to install the GTK+ Win32 DLLs next.
Installing GTK+ Win32 DLLs on your Windows machine
You can find these files originally in theD:\GTKWIN32\LIB\ directory when you initially extracted, move them to C:\WINDOWS\SYSTEM\ [ Top of Section | Contents ]
Common Errors & Solutions
[ Top of Section | Contents ]