Psi-Qt4-Windows Build Instructions

From PsiWiki

Disclaimer: These instructions are unofficial and may or may not work for you.

This page contains instructions on how to build the Psi-Qt4 branch on Windows platform. Please note that this branch is obsolete now (mainline is now Qt4) and some of the following instructions will likely be incorrect either now, or in the near future.

Notes:

  • Psi-Qt4 is a current name for future Psi-0.11.
  • Psi-Qt4 won't compile using Qt3.
  • If You want to compile Psi version <= 0.10, please consult Psi/Windows build instructions article.
  • If You want to compile Psi-Qt4 using MinGW compiler, please consult official Build Instructions Qt4 article.

Contents

Warning

Please note that the build instructions on this page are for compilers not officially supported for compiling Psi. It is Strongly Recommended that you compile using mingw, instructions for which are on the Build Instructions Qt4 page.

Getting started

Note:

Let us suppose that all files required to compile Psi-Qt4 will be located in C:\Psi-Qt4 directory or its subdirectories. We'll create them as needed. Psi-Qt4 prerequisites such as C++ compiler (installation and setup is not covered by this article), Qt4 library and OpenSSL will be installed elsewhere.

Create C:\Psi-Qt4 directory now.

Available compilers

Psi-Qt4 can be compiled using a variety of C++ compilers available on Windows platform:

  • Microsoft Visual C++ .NET 2003
  • Microsoft Visual C++ 2005
  • MinGW

Notes:

  • Microsoft Visual C++ 6.0 (with any Service Pack and Platform SDK installed) is unable to compile Qt4.
  • Microsoft Visual C++ .NET (a.k.a. Microsoft Visual C++ .NET 2002) may also be able to compile Qt4 and Psi-Qt4.
  • Microsoft Visual C++ .NET 2003 compiler has been released for free as Microsoft Visual C++ Toolkit 2003
  • Using Microsoft Visual C++ .NET and Microsoft Visual C++ .NET 2003 require You to have Microsoft Platform SDK installed and configured for use. Microsoft Visual C++ 2005 contains newest available Microsoft Platform SDK bundled in and therefore does not require its separate installation.
  • MinGW is one of ports of gcc/g++ compilers for Windows platform. This compiler will be used for creating official Psi-Qt4/Windows builds.
  • Compilers other than MinGW are not officially supported by Qt4/OpenSource and Psi developers. If You use them to create Psi-Qt4 build, then You're on Your own.
  • Commercial editions of Qt4/Windows support more compilers (for example Intel C++ Compiler and Watcom C++ Compiler), but OpenSSL for Windows package (required by QCA2 library, which in turn is required by Psi-Qt4) does not.
  • You cannot use the freely downloadable Microsoft .NET Framework SDK to compile Psi-Qt4.

Getting and compiling Qt4

Psi-Qt4 is based on Qt4, which is incompatible with Qt3 (both on binary and source level). Currently Psi Dev Team uses Qt-4.1.0 for building Psi-Qt4.

Getting Qt4

Qt4/Windows is distributed on two different licenses - OpenSource and Commercial:

  • Qt4/OpenSource is available for free (Official Qt4/OpenSource download site), but it supports only MinGW compiler. This edition is the only one used and supported by Psi developers.
  • Commercial Qt4 editions (Qt4/Console, Qt4/DesktopLight and Qt4/Desktop) are not free, but they also support other compilers (including Microsoft Visual C++ and Borland C++).

Qt4/OpenSource comes precompiled with release version of Qt4 for MinGW (of course, the sources for Qt4 are also provided).

Note:

  • It is possible however, to patch Qt4/OpenSource (Qt/Win project on SourceForge) to be able to use C++ compilers other than MinGW. If you use Qt/Win, you lose the support for Qt4/OpenSource from Trolltech (and Psi-Qt4 support from Psi developers).

Installing Qt4

Once You have downloaded Qt4/OpenSource, simply install it by running the installer software (ie. the .exe file You have downloaded). Let us suppose now that You have installed it to C:\Qt\4.1.0 directory, which is a default location for Qt-4.1.0 (if You have installed it elsewhere, You only have to change the paths below to point to Your location of Qt4/OpenSource).

Note:

  • When You install Qt4/OpenSource, You get an option to install MinGW as well. Just select that You don't have MinGW yet during Qt4/OpenSource installation process - MinGW installer will get downloaded.

Compiling Qt4

On information how to build Qt4 on Windows, please consult Compiling Qt4 on Windows.

Note:

  • After compiling Qt4/OpenSource, don't close the development command-line window, as it will be used later.

Getting and compiling QCA2

QCA2 (Qt Cryptography Architecture, version 2) is required to build Psi-Qt4.

Note:

  • Psi versions 0.9.3 and 0.10 required QCA (QCA version 1), which used Qt3. QCA2 uses Qt4.

Getting QCA2

Download QCA2 sources to C:\Psi-Qt4 directory and unpack it there. You will get qca-2.0-beta1 subdirectory. Rename it to QCA2 (so You will get C:\Psi-Qt4\QCA2 directory).

Compiling QCA2

Before building QCA2, in C:\Psi-Qt4\QCA2\crypto_win.prf file, replace line

 QCA_PREFIX = /local

to make it point to location of QCA2 files

 QCA_PREFIX = C:/Psi-Qt4/QCA2

Note:

  • The path in the line above uses UNIX-style slashes instead of Windows-style backslashes to separate directories on the path.

Copy C:\Psi-Qt4\QCA2\crypto_win.prf file (after saving) to C:\Qt\4.1.0\mkspecs\features\crypto.prf file.

In development command-line window execute following commands:

 cd C:\Psi-Qt4\QCA2
 qmake
 nmake

Note:

  • If You have compiled QCA2 before, please precede those commands with this one:
 set QMAKESPEC=win32-msvc.net

if You use Microsoft Visual C++ .NET compiler, or

 set QMAKESPEC=win32-msvc2005

if You use Microsoft Visual C++ 2005 compiler.

Now Your QCA2 for Microsoft Visual C++ is ready to use.

Getting and building Psi-Qt4

Now, You're ready to get Psi-Qt4 sources and build Your own Psi-Qt4/Windows.

Requirements for Psi-Qt4

Psi-Qt4 is currently available only from Darcs repositories. Download Darcs client.

Unpack the archive and put darcs.exe binary to C:\Psi-Qt4 directory.

Getting Psi-Qt4

In development command-line window run following commands:

 cd C:\Psi-Qt4
 darcs get http://dev.psi-im.org/darcs/psi-qt4

Compiling Psi-Qt4

Compile using MinGW

In development command-line window run following commands:

 cd C:\Psi-Qt4\psi-qt4
 qmake
 mingw32-make

Compile using Microsoft Visual C++

In development command-line window run following commands:

 cd C:\Psi-Qt4\psi-qt4
 qmake
 nmake

Getting and building QCA-OpenSSL

QCA-OpenSSL is a successor of QCA-TLS plugin used in Psi-0.9.3 and Psi-0.10. It's required for SSL encrypted connections from Psi client to Jabber server.

Requirements for QCA-OpenSSL

QCA requires You to have OpenSSL headers available. You can get them from OpenSSL.org. Install OpenSSL for Windows release, this will put all required files on Your disk.

Let us suppose that You have installed OpenSSL to C:\OpenSSL directory, which is a default location for the above OpenSSL for Windows release.

Getting QCA-OpenSSL

Download QCA2-OpenSSL sources to C:\Psi-Qt4 directory and unpack it there. You will get qca-openssl-0.1-20050811 subdirectory. Rename it to QCA-OpenSSL (so You will get C:\Psi-Qt4\QCA-OpenSSL directory).

Compiling QCA-OpenSSL

In development command-line window execute following commands:

 cd C:\Psi-Qt4\QCA-OpenSSL
 qmake
 nmake

Now Your QCA-OpenSSL for Microsoft Visual C++ is ready to use.

Packaging Psi-Qt4

After all files have been built, You have to copy all the files into their place:

 cd C:\Psi-Qt4\psi-qt4
 set system=%windir%\system
 if "%OS%" == "Windows_NT" set system=%system%32
 mkdir psiwin
 copy src\debug\psi.exe psiwin
 copy %QTDIR%\bin\qt*4d.dll psiwin
 mkdir psiwin\crypto
 copy ..\QCA-OpenSSL\debug\qca-openssl.dll psiwin\crypto
 copy ..\QCA2\lib\qca2.dll psiwin
 copy %system%\libeay32.dll psiwin
 copy %system%\ssleay32.dll psiwin
 xcopy /d /e certs psiwin\certs\ > nul
 xcopy /d /e iconsets psiwin\iconsets\ > nul
 xcopy /d /e sound psiwin\sound\ > nul
 copy COPYING psiwin > nul
 copy README psiwin > nul

Note:

  • You have used Microsoft Visual C++ 2005 to build Your Psi-Qt4, You have to merge Your manifests with your .exe and .dll files. Copy all manifest files for psi.exe, qca2.dll and msvc***.dll to C:\Psi-Qt4\psi-qt4\psiwin directory and run
 mt -manifest psi.exe.manifest -outputresource:psi.exe;#1
 mt -manifest qca2.dll.manifest -outputresource:qca2.dll;#2
 for %%f in (msvc*.dll) do mt -manifest %%f.manifest -outputresource:%%f;#2

Links

Compiler related:

Qt4 related:

OpenSSL:

QCA2, QCA2-OpenSSL and Psi-Qt4 sources:

See also