Building on Windows

From Avimator

Jump to: navigation, search

Being a Qt application, Qavimator uses the qmake build system. qmake provides painless cross-platform building. However, the project files provided in the svn repository are not sufficient for a clean windows build, nor are any files provided for building the windows installer. Workarounds for the project file problems are described below, but optimally the actual files used to build the released binary would be provided in subversion.

Contents

Get the Source

I put it at C:\qavimator

svn co https://qavimator.svn.sourceforge.net/svnroot/qavimator qavimator

MinGW

We will use a MinGW (Minimalist GNU for Windows) compiler environment. Dowmload the mingw installer and select the g++ compiler and the make program for installation.

http://www.mingw.org/download.shtml

Install mingw in a directory that does not have any spaces in it. I.e., no "C:\Program Files". I used C:\mingw

The compiler looks for the GLU library as libglu.a, but mingw calls it libglu32.a. Copy the C:\mingw\lib\libglu32.a file to C:\mingw\lib\libglu.a

Qt

Trolltech did not make a release of Qt 3 compatible with mingw. Instead download the third party project Q... Windows Edition:

http://qtwin.sourceforge.net/qt3-win32/binary.php

We need to use an old binary release, because using a newer release compiled ourselves causes the timeline control to break (note: 3.3.8 and 3.3.4 both seem to cause problems, but 3.3.4 less so than 3.3.7. Zi says she is using 3.3.6, which is distributed as source-only. I'll add instructions for buildng 3.3.6 soon). Get this package from the sourceforge download page: setup-qt-win-free-mingw-3.3.4-3.exe

Install qt in a directory that does not have any spaces in it. I used C:\qt-win-free-mingw-3.3.4

GLUT

We need the GLUT library (OpenGL Utility Toolkit). Download the windows binary:

http://www.xmission.com/~nate/glut.html
  • glut32.dll will be needed by Qavimator at runtime. Copy it to qavimator\bin.
  • glut.h will need to be available to the compiler in a GL\ subdirectory of a compiler include directory. I put it into C:\mingw\include\GL
  • glut32.lib needs to be available to the compiler in a library directory. I put it into C:\qavimator\src

Fix the project file

The project src\src.pro assumes a unix filesystem.

Change the line
DEFINES += QAVIMATOR_DATAPATH=\"/usr/share/qavimator\"
To this
DEFINES += QAVIMATOR_DATAPATH=\"C:\\qavimator\\bin\"
And the line
datafiles.path = /usr/share/qavimator/data
To this
datafiles.path = C:\qavimator\bin\data

We also need to tell it where the glut library is

Change the line
-lglut \
To this
glut32.lib \

Build

Open a command prompt and set up the build environment (if your directories are different use them instead of mine):

C:\> set QTDIR=C:\qt-win-free-mingw-3.3.4
C:\> set MINGW=C:\mingw
C:\> set PATH=%QTDIR%\bin;%MINGW%\bin;%PATH%
C:\> set QMAKESPEC=win32-g++

Now build libquat

C:\> cd qavimator/libquat
C:\qavimator\libquat> qmake
C:\qavimator\libquat> mingw32-make

Now build qavimator

C:\qavimator\libquat> cd ..
C:\qavimator> qmake
C:\qavimator> mingw32-make

Copy supporting DLLs

The following files should go into the Qavimator bin directory:

  • C:\mingw\bin\mingwm10.dll
  • C:\qt-win-free-mingw-3.3.7\bin\qt-mt3.dll
  • glut32.dll (copied earlier with the other files from glut)
Personal tools