Windows Build Instructions
This document explains how to compile the development version of Stellarium on WinXP. The easiest method is to use QtCreator as described in this page. However it is also possible to compile using MSYS or MS Visual C++. See CompileWithMSYS and CompileWithVisualCpp.
Building with Qt Creator (Prefered method)
Stellarium can be built in Windows XP as below. If you use Vista 32 bit or Windows 7 32 bit. The procedure should be the same. However I have tried Vista home basic and Qt creator does not work there because it needs cwctype declared. Msys compiling works OK in Vista home. If you have the 64 bit version it will be necessary to install the Virtual XP version from Microsoft (470MB download) and the virtual computer interface from Microsoft or VMware.
The virtual XP program will then need to be fully set up as a complete separate virtual XP installation with all the below dependancies including the environment variables. When Stellarium is compiled a package can be made that can be installed in the Program Files (x86)of Windows 7 64 bit (or anywhere else you fancy). Only tested on Windows 7 64 bit ultimate where it runs without problems.
I upgraded my development environment on windows (XP), and decided to start from scratch, and write what I do. I managed to compile and run Stellarium pretty quickly *without using the windows command line or msys* by following these steps.
Go to the bzr checkout instructions first
1- Install a SVN command line client: CollabNet Subversion Command-Line Client works fine. To get this you will need to register and download Collabnetsubversion-server-1.6.9-1.win32.exe from http://www.collab.net (subversion). Run this and install it in your preferred location or use the default
2- Download and install the latest version of Qt SDK. Current version 2010.05 (4.7.0) SDK (includes Qt libraries, Mingw, gdb, Qt Creator) from http://qt.nokia.com and install it. Remove any earlier version first
I installed it to C:\Qt\4.7.0 rather than the default location of C:\Qt\2010.05
3- Download and install cmake 2.8 from http://www.cmake.org and install it. Remove any earlier versions first
4- For Qt Creator/cmake to find the mingw environment you now need to add some directories to your path. Assuming you installed everything in the location C:\Qt\4.7.0 you should add in your path:
C:\Qt\4.7.0;C:\Qt\4.7.0\qt\bin;C:\Qt\4.7.0\mingw\bin;C:\Program Files\CMake 2.8\bin; C:\Qt\4.7.0\mingw\lib;C:\Qt\4.7.0\mingw\include
You can edit your path in the "system property" dialog of windows (easy on XP but a little more obscure in Vista and Windows 7). Be very careful editing the path, any syntax errors will stop the creation of the cmakecache.txt when paths can't be found. Remove the paths to other instances of mingw.
You need to (re)start Qt Creator after this.
5.1- Gettext: Download the "Complete package, except sources" installer from http://gnuwin32.sourceforge.net/packages/gettext.htm and install it in C:\Qt\4.7.0\mingw\ It will install everything we need in the mingw environment.
5.2- libIconv: Download the "Complete package, except sources" installer from http://gnuwin32.sourceforge.net/packages/libiconv.htm and install it in C:\Qt\4.7.0\mingw\ It will install everything we need in the mingw environment.
5.3- zlib: Download the "Complete package, except sources" installer from http://gnuwin32.sourceforge.net/packages/zlib.htm and install it in C:\Qt\4.7.0\mingw\ It will install everything we need in the mingw environment.
6- Create a folder “\prog\ before you start Qt creator. Start Qt Creator and tell it where your svn.exe is in Tools/Options../Version Control/Subversion.
My program automatically installed in /program files/Collabnet/subversion Server
7- Create a new project File/New File or Project/Version Control/Subversion Checkout, and give the following url:
bzr co lp:stellarium
and tell it to put it in the directory of your choice: in my case, I had already created C:\prog\ The checkout should create the stellarium directory in there and the project headers will be in Documents and settings\your name\stellarium .
8- Once the source code is checked out, Qt Creator automatically detects a cmake-based project and launches the CMake Wizard. I tell it to build stellarium in C:\prog\stellarium\qtcreator-build .(default location) Then run cmake using the MinGW target. This will configure cmakecache.txt in the qtcreator-build folder (you can edit it if necessary) If this action fails to find any dependancies. check the cmakecache.txt you may need to manually install the requirement paths. When this completes OK click on finish.
9- If everything went well, click on the "build all" button in Qt Creator, and wait that everything is build. This can take some time for the first build and may show many warning messages. Watch the progress "build" bar in the left menu column. It will turn green when the build is complete. Click on build issues in lower window and you can see the progress. (warning messages that don't stop the build or major reasons that do). When it stops check the qtcreator-build\src folder to see the stellarium.exe and libstelmain.dll files. Copy these files to the stellarium folder. Go to the Qt\4.7.0\qt\bin and copy
zlib1.dll .... from qt/4.7.0/mingw/bin
To the stellarium folder
Create a folder sqldrivers in stellarium
Go to the Qt\4.7.0\qt\plugins\sqldrivers folder and copy qsqlite4.dll to this folder
10. Run Stellarium and enjoy
Making the Package
To make an intallation package you will first need to download and install the Inno installer
From http://www.jrsoftware.org download isetup-5.2.3.exe, run it to install.
There is a stellarium.iss file in the stellarium source folder that holds the package compiler source to be used with the inno compiler.
This file will look for all the necessary components in a folder \program files\stellarium created by the "make install" command
When all this is prepared it is only necessary to click on the stellarium.iss file to load it and then compile under the build heading.
The package will be built and placed in a new folder created "installers". The package will be "stellarium-0.10.5-win32.exe". This package can then be run on any XP, Vista or Windows 7 computer. Note:- If you are installing on a 64 bit computer the program will need to be placed in the Program files (x86) folder, not the Program Files folder.