This document describes how to compile dia for Win32.
Dia is a diagram editor. More information about dia can be found on the dia homepage, http://www.lysator.liu.se/~alla/dia/. The dia homepage has links to the latest dia sources.
A binary distribution of dia for Win32 is available from http://dia-installer.sourceforge.net.
This section describes which tools are required in order to compile dia with the current set of makefiles.
The MS Visual C++ compiler is used to compile dia for win32. Versions 5, 6 have been used successfully. The compiler is invoked using the cl command.
When compiling with Visual C++ version 7, you'll have to recompile all libraries as you'll have to link against msvcrt7.dll instead of msvcrt.dll.
Compiling dia for win32 with gcc from the MinGW distribution should be possible. However, compilation with gcc is not covered in this document.
Dia depends on a number of libraries, most noticeable the GTK+ toolkit. Instead of compiling all those libraries from scratch, it is recommended to use prebuild binaries of the relevant libraries.
Developer packages of the libraries are available from http://dia-installer.sourceforge.net/sources.html. However the original websites of the different projects are mentioned below in order to make updating easier.
The GTK+ toolkit is available from http://www.gtk.org
The GnuWin32 project provides binaries for a number of open source libraries and tools. The homepage of the project is http://gnuwin32.sourceforge.net.
In order to build dia with the libart renderer, it is recommended to use the libart and freetype development packages provided by GnuWin32.
A libxml2 version with zlib compression support should be used. The Dia Win32 Installer home page provides such a version.
The Dia Win32 Installer homepage provides a binary and source packages suitable to be used with the dia XSLT plug-in.
Tor Lillqvist has packaged fontconfig for Win32. This version is available from the Dia Win32 Installer home page.
Fontconfig depends on expat. Expat is available from http://expat.sourceforge.net
Any serious dia development should use the latest dia sources from GNOME CVS. The dia homepage (See introduction) contains information on how to obtain the latest dia sources from CVS.
WinCVS is an excellent CVS client for Windows. The CvsGui homepage, http://cvsgui.sourceforge.net has all the details.
This section describes in which structure the various sources have to be arranged in order to compile dia. Please follow these steps:
Choose a folder under which all sources will be kept. This folder will be referred to as $TOP in the following.
Download the GLIB, ATK, PANGO, GTK, fontconfig files from the Dia Win32 Installer homepage. Extract to $TOP.
Download expat from http://expat.sourceforge.net and install to $TOP.
Download http://umn.dl.sourceforge.net/sourceforge/gnuwin32/libart-2.3.3-1-lib.zip and http://umn.dl.sourceforge.net/sourceforge/gnuwin32/libart-2.3.3-bin.zip. Extract to $TOP.
Download http://umn.dl.sourceforge.net/sourceforge/gnuwin32/freetype-2.1.8.exe Install to $TOP.
Download http://umn.dl.sourceforge.net/sourceforge/dia-installer/libxml2-2.6.11.zip. Install to $TOP.
Download http://umn.dl.sourceforge.net/sourceforge/dia-installer/libxslt-1.1.8.zip.
Extract to $TOP.Download libpng and zlib from http://gnuwin32.sourceforge.net. Install to $TOP.
Download WIMP from gtk-wimp.sourceforge.net. Install to $TOP.
copy dia\config.h.win32 dia\config.h
copy bin\glib-genmarshal.exe include\glib-2.0\gobject
Comment out unistd.h line in zconf.h
Add LIBART_CFLAGS to make.msc
Download http://uml.dl.sourceforge.net/sourceforge/dia-installer/dia_extra_src_msvc_dia_0.94-pre1.zip and unzip to $TOP.
This is replacing files. Make sure that you unzip this file last.
Find out in which directory your copy of MS Visual Studio is installed. This directory will be referred to as $MSVC in the following.
There are several ways to set Environment variables: Either through the System in the Control Panel or through commands in the command line with the set command. As the variables set through the Control Panel are persistent, you might prefer this way.
Replace $TOP and $MSVC with the real directory names.
The LIB environment variable is used by the linker. It should contain at least the following directories (MSVC Version 6):
$MSVC\VC98\lib
$TOP\lib\
The INCLUDE environment variable is used by the compiler. It should contain at least the following directories (MSVC Version 6):
$MSVC\VC98\include
$TOP\include
The PATH enviroment variable is used by the commandline interpreter to determine the location of executables. It should contain at least the following directories (MSVC Version 6, Windows 2000):
$MSVC\VC98\bin
$MSVC\common\msdev98\bin
$TOP\bin
c:\winnt\system32
With the setup mentioned above, you should be able to compile dia out of the box. However, you should know which files control the build process. In addition to the various makefile.msc's that are introduced below, there are two important files:
$TOP\glib\build\win32\make.msc, included by makefile.msc
$TOP\glib\build\win32\module.defs, included by make.msc
If you're working with updated versions of some of the libraries you may have to edit these files.
Starting from $TOP/dia, the following commands are necessary to compile dia:
cd lib nmake makefile.msc cd ../app nmake makefile.msc cd ../objects nmake makefile.msc cd ../plug-ins nmake makefile.msc
In order to run dia sucessfully, the binaries have to be put in the correct file structure.
A makefile is provided to copy the necessary files together. Starting from $TOP/dia, run the following command:
nmake makefile.msc
Congratulations, you should now be able to run your copy of dia by executing $TOP/dia/build/win32/bin/dia.
Make sure to read the information provided by Hans Breuer and Tor Lillqvist, in particular the comments in the build files and the files named *.win32 in the glib, GTK+ and dia sources
The archives of the dia and gimpwin-dev may contain useful information.
If none of the above sources contain information to solve your problem, contact the author of this document: Steffen Macke <sdteffen@web.de>