Steps

Step 1.

Install Visual C++ 6 or the .Net Framework SDK and Platform SDK. Make sure
that the binaries (bin) are available in the system path and the libraries
(lib) and includes (include) are programmed as SET variables. Here is an
example of how to setup a minimal Visual C++ installation (from http://wiki.tcl.tk/11970).

The standard installation of Microsoft Visual Studio is some 400MB. I recently needed to do some debugging on a machine that I didn't want to install VC6 on (because it can be hard to properly uninstall). However, if all you need is VC6 to compile stuff, then you don't need all the other stuff. Here is how. Note that my target was building tcl - if you are building something else you may need to copy a few more bits.

Create the following directory tree.

vc6
|-bin
|-include
|-lib

Copy the whole of lib and include directories from your VC98\ to your new
tree. Then copy from the VC98\bin directory to your bin directory cl.exe,
c1.dll, c1xx.dll, c2.dll, cvtres.exe, lib.exe, link.exe and nmake.exe Then copy
from MSDev98\bin to your bin mspdb60.dll, rc.exe and rcdll.dll.

Setup a vc6setup.bat file with the following to create a build
environment

** Note. This will only alter the path and environment variables for that
shell session. You have to place these items into the permanent path and
environment if you want them to persist across command sessions.

The installation takes about 70MB disk space so can easily be put on a USB
memory stick if needed.

Once you have finished on the target system a simple rmdir /q /s vc6 will
get rid of the whole lot.

I use this setup for building my binary packages, but setting something
similar for the .Net Framework SDK and Platform SDK will also work.

Step 2.

You need to install ExtUtils::Depends and ExtUtils::PkgConfig. A suitable
version of ExtUtils::Depends is available via ActiveState PPM, but
ExtUtils::PkgConfig is not available. You will have to compile it from source.
Download it from the Gtk2 Sourceforge downloads page (http://sourceforge.net/projects/gtk2-perl).

** Note. You need to patch ExtUtils::Depends and ExtUtils::PkgConfig when compiling from source before they will install on Windows. Open up "Makefile.pl" for each package, find the line

sub postamble {

and place the following code at the beginning of the subroutine:

return @_ if $^O eq 'MSWin32';

The authors have been notified of this and will implement a patch in later
versions.

This is fixed as of ExtUtils::Dependsg 0.205 and ExtUtils::PkgConfig
1.07. -- muppet

The * stands for the version number. Get whatever the latest version is.
Unzip all of the files into c:\usr (or some other location). It is not
necessary to separate the runtime files from the development files. Add the
following to your system path: "c:\usr\bin;c:\usr\lib;"

Step 4.

Compile and install Glib perl. Download the Glib source from the Gtk2
Sourceforge downloads page (http://sourceforge.net/projects/gtk2-perl). Unpack
the tar.gz into a directory, open cmd.exe and change to the directory where you
unpacked the source code. Type the following:

> perl Makefile.pl
> nmake test

You may get a stop error about "command too long". If this is the case,
look at the perl command that was called in Makefile, find the line and remove
all spaces from the command. Save the file and rerun nmake. This is due to
string length limitations in Microsoft shells. Removing the spaces from the
command should bring you under the limit of 2047 characters.

Once the files have compiled and tests have pass ok, create a ppd
distribution and install your brand new shiny Glib perl via PPM. See Appendix
A for notes on creating a .ppd file.

Step 5.

Compile and install Gtk2 perl. Download the Gtk2 source from the Gtk2
Sourceforge download page (http://sourceforge.net/projects/gtk2-perl).
There is a bug in Glib::MakeHelper that prevents "perl Makefile.pl" from
properly detecting xs and map files.

This bug is fixed as of Glib 1.073 and will be in the stable 1.080
release. -- muppet

Change into the directory where you unpacked your Gtk2 source. Type the
following:

> perl Makefile.pl
> nmake

If there are any failures in nmake (unexported symbols), you will either
need to comment them out in the source or contact the mailing list for
assistance. Once nmake has successfully compiled your binaries you can
optionally run

> nmake test

but it takes a long time and tells you about all kinds of failures that
really are only significant to the developers. So, just skip that part.
(In general, however, test suites are a good thing, and help assure you
that the software you just built is okay. If you can debug and fix any of the
failures, which are mostly due to different behavior of gtk+ on win32 than on
x11, please let us know and we'll fix it upstream. -- muppet)

Package Gtk2 into a .ppd and install it via PPM. (See Appendix A).

Now change into the gtk-demo directory and run: perl main.pl. Test out your new build to see if it works!