This page contains information about Gnome-DB on Microsoft Windows.


The only compilation environment tested is using the GCC compiler in a MinGW cross-compilation environment on a Linux box and the native MingW compiler on a Windows machine. The compiled DLLs and executable files natively use the Windows API and don't require any abstraction DLL. If you have any experience with compiling Gnome-DB on another environment (GCC running on Cygwin, or building with MSVC), please tell me so I can update this information.

The resulting DLLs and executable have been tested on a WinXP environment. There should be no problem with other versions of Windows as long as it is supported by the dependencies and the MinGW environment. Again if you have successfull (or not) experiences with other versions of Windows, please tell me.


GCC in MinGW cross compilation

The first step is to install the cross compilation environment. The MinGW page contains little information about how to set up such an environment, but depending on your Linux distribution, the install is fairly simple:



The Gnome-DB dependencies are required before compiling, they are available for download from the Gnome FTP server. To compile, the DLL and the dev ZIP files are required (to run, only the DLL packages are required). The dependencies are:

and optionally:

All these ZIP files must be uncompressed into the same directory (such as /local/Win32).

Compiling natively on Windows with MingW

You can also compile libgda and gnome-db natively on Windows with the mingw compiler. You need to install the mingw compiler and the msys shell, both of which are available at msys is a minimal unix-like shell environment for Windows to execute configure scripts in.

Then, you need to install libgda's dependencies. They are available from the same location as described above. I installed these into my msys base directory at C:\msys. You need both runtime and development packages. For the compiler to find the include files and libraries, write something like this in a file called ~/.profile (or something like C:\msys\home\username\.profile if you are not within the msys shell):

  export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/local/lib/pkgconfig
  export CFLAGS="-I/include"
  export CXXFLAGS="-I/include"
  export CPPFLAGS="-I/include"
  export LDFLAGS="-L/lib"

(perhaps CPPFLAGS is already enough). Then, you need to install the dependencies for the providers you want to enable in gda. I only tried postgresql so far (apart from the included sqlite). There might be binary packages available, but it is also possible to build it from source: Get a tarball from and unpack it into your msys home directory. Type

  CFLAGS="-D_SYS_TIME_H_" ./configure

The -D_SYS_TIME_H is to prevent postgresql from including sys/time.h. The gettimeofday() declaration in that header would otherwise conflict with postgres' own implementation. Now, running make and make install should run without problems. When finished, you need to add the following into your ~/.profile, since postgres was installed in /local/pgsql:

  PATH: /local/pgsql/lib
  CFLAGS: -I/local/pgsql/include
  CXXFLAGS: -I/local/pgsql/include
  LDFLAGS: -L/local/pgsql/lib

Again, perhaps CPPFLAGS instead of CFLAGS and CXXFLAGS works, too. Before proceeding, relogin into the msys shell for the changes to take effect.

Then, load a libgda tarball, unpack it into your msys home directory and run ./configure && make && make install. If your tarball is older than 3.1.3, then you probably need to configure with LDFLAGS="-liberty" because of bug #502481.


An environment must be set-up for cross compilation, to avoid finding and using native libraries. Setting up that environment is done using shell environment variables. The links above show various scripts for that purpose; I recommend using this mingw-configure script (see How to guide for cross-compiling GTK+ for Win32)

To compile:

  1. set the GTK_PREFIX environment variable must be set to where the ZIP files have been uncompressed (/local/Win32 for example)

  2. run the mingw-configure script in the top directory of libgda instead of the usual configure script (note that the configure script must exist because it is called by the mingw-configure script)

  3. run the usual make and make install commands

Important notes:


This paragraph deals with installation in a Windows environment.


Unzip the dependencies ZIP files mentionned above (not the dev ones, they are not needed at this point) into some folder on the Windows machine, for example C:\Devel, then add C:\Devel\bin to your PATH. (In case some of the DLLs end up in the lib folder, move them to the bin folder.)

How to manipulate PATH depends on your Windows version. For NT, Windows 2000 and XP, use the Control Panel's System tool.

libgda files

The files generated when running make install for libgda can then be copied into some folder on the Windows machine (which does not need to be the same as for the dependencies).

GnomeDbMinGW (last edited 2010-01-16 17:52:24 by VivienMalerba)