Windows build guide

From LeechCraft
Jump to: navigation, search
This article is incomplete, help us improve it.

General information

Tested platforms and toolchains



There are some known issues with the MinGW compiler. MinGW impementation of WinAPI headers defines some macros with names like GetObject or SendMessage, and these macros conflict with the names of some API methods in LeechCraft. Since Qt pulls these headers in, LeechCraft becames unbuildable.

One possible solution could be just renaming these functions in upstream, but that seems very kludgy and is rejected — better use better WinAPI headers.

Fixed in upstream some time before 0.5.95.

Build instructions

Dependencies overview

  • git to check out our source code. msysgit is recommended.
  • Qt 4.8.
  • Boost 1.48 or higher.
  • CMake 2.8.7 or higher.
  • OpenSSL 0.9.8 or higher.
  • Rasterbar Libtorrent 0.15 or higher (though 0.15 is recommended) for the BitTorrent plugin.
  • QJson 0.7 or higher for NetStoreManager GoogleDrive and Poshuku OnlineBookmarks plugins.
  • QXmpp from our git master branch for the Azoth Xoox plugin.
  • libmsn 4.1 or higher for the Azoth Zheet plugin.
  • Speex 1.0 or higher for the Azoth plugin with ENABLE_MEDIACALLS feature enabled.
  • Qross 0.2 for our Qrosp plugin.
  • QScintilla 2.5 or higher for the Popishu plugin.
  • [Gpg4win|]. Проследить, чтобы gpg.exe был в PATH


Visual Studio 2012

Building Qt

Current Qt stable version (4.8.2) doesn't support MSVC2012 compiler. To achieve compatibility try following steps:

or download my patched build


  • There is no Qt Visual Add-in version exists for MSVC2012 at this moment.
  • Use this method at your own risk and bugs :)
Building QXmpp
mkdir build
cd build
qmake ../ -config release PREFIX=C:\\Project\\installed\\qxmpp
nmake install
Building pcre
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DPCRE_SUPPORT_JIT=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\pcre

build and install in msvc2012

Building QJson
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\qjson

build and install in msvc2012 Hint: If CMake gives an error like sh.exe was found in your PATH, just ignore it and run the command again. CMake always seems to do this in an empty build directory.

Building TagLib
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\taglib

build and install in msvc2012

Building Gpg4win

Качнуть и установить Проследить, чтобы gpg.exe был в PATH

Building QCA

Last svn trunk version has CMake support. We'll use it.

svn checkout svn://
cd qca
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\qca

build and install in msvc2012 copy and installwin.bat into install dir

cd D:\Project\installed\qca
Building Qxt
configure.bat -release -prefix D:\Project\installed\qxt
nmake install
Building liblastfm
git clone
cd liblastfm
mkdir build
cd build
cmake ../ -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\liblastfm
Building Qwt

Get Qwt:

svn checkout svn:// qwt-trunk

Edit qwtconfig.pri and set:

win32 {


win32 {
    QWT_INSTALL_PREFIX    = D:/Project/installed/qwt


mkdir build
cd build
qmake ../
nmake install
Building Qross
git clone qross-trunk
mkdir build
cd build
cmake ../src/qross -G "Visual Studio 11" -DCMAKE_INSTALL_PREFIX:PATH=D:\Project\installed\qross
Building LeechCraft


git clone
cd leechcraft
set CMAKE_PREFIX_PATH=D:\Project\installed\boost;D:\Project\installed\OpenSSL-Win32;D:\Project\installed\pcre;D:\Project\installed\perl;D:\Project\installed\qca;D:\Project\installed\qjson;D:\Project\installed\qross;D:\Project\installed\qwt;D:\Project\installed\qxmpp;D:\Project\installed\liblastfm;D:\Project\installed\qxt;D:\Project\installed\taglib;D:\Project\speex-dev;D:\Project\libogg\include
cd \leechcraft\tools\win32\build32

Visual Studio 2010


Building Qt

Скачать последний Qt 4.8.x, распаковать.

Создать файл configure.cache в папке с Qt:


В обычном cmd.exe (с путями к компилятору mingw в PATH) выполняем (хотя, можно и вручную, через диалог Windows):

setx LIB "%LIB%;C:\Installed\OpenSSL\lib;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86"
setx INCLUDE "%INCLUDE%;C:\Installed\OpenSSL\include;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include"

Перезапускаем cmd.exe и пишем:

cd c:\Dev\qt-4.8.4
configure -redo
mingw32-make -j6

Идем гулять...

Building Boost
cd c:\Dev\boost
bootstrap.bat mingw
bjam install toolset=gcc link=shared runtime-link=shared threading=multi --without-context --prefix="c:\\installed\\boost-1.53"
Building hunspell

Скачать Hunspell, распаковать. В MinGW Shell:

cd /c/Dev/hunspell-1.3.2
./configure --prefix=/c/Installed/hunspell-1.3.2
make install
Building LibMagic (File utility)

Скачать _, распаковать.

cd /tmp
tar --directory /mingw -xzf mingw-libgnurx-2.5.1-bin.tar.gz
tar --directory /mingw -xzf mingw-libgnurx-2.5.1-dev.tar.gz
cd /c/Dev/file-5.14
./configure --prefix=/c/Installed/file-5.14
make install
Building kQOAuth

Open regular cmd.exe with mingw enviroment, cd to yuor build dir then

git clone git:// kQOAuth-trunk
cd kQOAuth-trunk
mkdir build
cd build
qmake ../
mingw32-make install