Building on Windows


Notes


Getting dependencies

  1. GTK

    Get the following binary + dev packages from GTK:

    • GLib
    • GTK+
    • Pango
    • ATK
    • cairo
    • zlib
    • win_iconv
    • gettext
    • libpng
    • libjpeg
    • libtiff

    Also get the following binary packages:

    • Freetype
    • Fontconfig
    • expat

    Download:

    Please note that sometimes the links are outdated or simply wrong (dev link pointing to bin package, etc.), so you might have to check them one by one.

  2. OpenSSL

    Go to Shining Light Productions, and download the latest OpenSSL installer (the 7 MB file, not the redistributable or light version). Install it into a temporary folder on your desktop, for example. Choose to install binaries into that folder, too. You will need the bin, exp, include and lib subfolders in the next step. After 3), you can safely uninstall OpenSSL.

  3. Extract all GTK files and copy the OpenSSL files to a suitable place, such as a folder in your Documents:

    • XP: C:\Documents and Settings\<user>\My Documents\deps
    • Vista: C:\Users\<user>\Documents\deps

    After all, you should only have the bin, etc, include, lib, manifest, share and src folders in deps. The file hierarchy of the archives is proper except one: in 32 bit zlib123-dll.zip copy zlib1.dll into bin instead of the root where it resides originally.

  4. ActivePerl

    Download and install ActivePerl 5.10.

  5. ActivePython

    Download and install ActivePython 2.6.

  6. ActiveTcl

    Download and install ActiveTcl 8.5 (only x86 is available).


Environmental variables

I won't provide information about how to set up an environmental variable. Use absolute paths for all of them (such as C:\Users\<user>\Documents\deps\bin).

  1. PATH : set to deps\bin (deps is where you put the GTK+ and OpenSSL files)
  2. 32 bit only
    • DepsCommon32 : path to deps
    • DepsPerl32 : where you installed ActivePerl
    • DepsPython32 : where you installed ActivePython
    • DepsTcl32 : where you installed ActiveTcl
  3. 64 bit only
    • DepsCommon64 : path to deps
    • DepsPerl64 : where you installed ActivePerl
    • DepsPython64 : where you installed ActivePython

Setting up Visual Studio

VS or VS Trial

  1. Install VS (VS Trial)

    • 32 bit: 'standard' install is okay
    • 64 bit: make sure to install as 'complete'

VS Express + Windows SDK

  1. Download and install the SDK. Make sure to install the SDK before installing VS Express, otherwise you may face problems with IntelliSense.

  2. Download and install VS Express (SQL Server is not needed to build freakschat). Please note that you won't be able to build 64 bit executables with Express.


Compiling the source

  1. Open freakschat.sln with VS.

  2. Select the desired solution configuration and platform (release/debug, 32/64 bit respectively).

  3. F6 (Build).


Creating a VS solution from scratch

You shouldn't need this, this is rather just a note if I want to recreate the solution for some reason.

  1. VS Project

    Create a new console application. Name it freakschat. Uncheck precompiled headers. In the solution's source folder (freakschat-$version\src) create three folders: common, fe-gtk, pixmaps. Copy the .c and .h files from the freakschat source into these, and then add them to your project. Also add vs-config.h, vs-dirent.h and vs-quirks.h to src.

  2. Includes

    In VS, in the project properties page (right click on src), under Configuration Properties / C/C++ / General / Additional Include Directories, enter:

    • $DEPS\lib\gtk-2.0\include
    • $DEPS\lib\glib-2.0\include
    • $DEPS\include\pango-1.0
    • $DEPS\include\libpng12
    • $DEPS\include\gtk-2.0
    • $DEPS\include\glib-2.0
    • $DEPS\include\gail-1.0
    • $DEPS\include\cairo
    • $DEPS\include\atk-1.0
    • $DEPS\include
  3. Under C/C++ / Preprocessor / Preprocessor Definitions, enter 'WIN32'.

  4. Under C/C++ / Advanced / Compile As, set to 'Compile As C Code (/TC)'.

  5. In Linker / General / Additional Library Directories enter '$DEPS\lib'.

  6. Libraries

    In Linker / Input / Additional Dependencies, enter:

    • gtk-win32-2.0.lib
    • atk-1.0.lib
    • gio-2.0.lib
    • gobject-2.0.lib
    • gdk_pixbuf-2.0.lib
    • gdk-win32-2.0.lib
    • pangowin32-1.0.lib
    • gdi32.lib
    • pangocairo-1.0.lib
    • pango-1.0.lib
    • cairo.lib
    • gmodule-2.0.lib
    • glib-2.0.lib
    • intl.lib
    • libeay32.lib
    • ssleay32.lib
    • ws2_32.lib
    • winmm.lib
  7. In Linker / System / SubSystem, set to 'Windows (/SUBSYSTEM:WINDOWS)'.


Compiling PO files

  1. Download the GetText Win32 binaries and its dependencies, more precisely:

    • gettext-0.14.4-bin.zip
    • gettext-0.14.4-dep.zip
  2. Extract

    • libexpat.dll
    • libgettextlib.dll
    • libgettextsrc.dll
    • libiconv2.dll
    • libintl3.dll
    • msgfmt.exe

    to freakschat/po.

  3. Run share/misc/compile-po.bat.

The resulting files will be placed in po/locale.