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.
For 64-bit builds see CompileWithMinGW-w64
Building with Qt Creator (Prefered method)
Note: This is a patched updated method to allow building from stellarium build 5492
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.
Note : I've tested compiling Stellarium with Qt Creator on windows seven and it appears to work fine.
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 Bazaar 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- At the moment Qt SDK does not contain the latest versions of Qt 4.8.2 for windows, MinGW or Qt creator so it will be necessary to obtain them and install them individually. Download this for installation after MinGW is installed.
Qt libraries 4.8.2 for Windows (MinGW 4.4, 318 MB)
from http://qt.nokia.com . Remove any earlier version first.
Next we will need the version of MinGW that contains Gettext and libintl versions 0.18.1.1-2. This will need to be built from the file:
It is at the top of the page. Run mingw-get-inst-20120426.exe (662.7kB) and it will install MinGW with GCC 4.6, Gettext-0.18.1.1-2, and libintl-0.18.1.1-2. This is quite a large down load and requires some additions to the starting menu.
In the select components menu MinGW compile suite and the C compiler are already ticked. Add ticks to C++ compiler and the last item MinGW Developer tool kit.
MinGW needs to be installed before any other dependencies as it location must be known by Qt and Msys.
Next we need a copy of Qtcreator, again obtained from http://qt.nokia.com and installed in Qt\4.8.2. Put the new MinGW here also to conform with previous builds.
Now we can install Qt libraries 4.8.2 for Windows (MinGW 4.4, 318 MB) into C:\Qt\4.8.2\Qt rather than the default location of C:\Qt\2010.01
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.1 you should add in your path:
C:\Qt\4.7.1;C:\Qt\4.7.1\qt\bin;C:\Qt\4.7.1\mingw\bin;C:\Program Files\CMake 2.8\bin; C:\Qt\4.7.1\mingw\lib;C:\Qt\4.7.1\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.1\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.1\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.1\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.1\qt\bin and copy
zlib1.dll .... from qt/4.7.1/mingw/bin
To the stellarium folder
10. Run Stellarium and enjoy
Stellarium will be automatically installed into a folder in your boot drive \program files\stellarium when "make install" is run and place the necessary files for use of the inno compiler in sub directories of this folder.
Note: Will someone please show how this is done from Qtcreator?
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.