CompileWithMSYS

This is the instruction for building Stellarium from version 0.10.2. using the MSYS system with Qt 4.7.1/MinGW. See also the Windows_Build_Instructions for the Qtcrator method which you may find easier.

Installation of development tools & libraries

Building with MinGW32

With the change in compiling to use Qt 4.7.1 compiling stellarium has now been made considerably easier and can be built successfully in Windows 2000, XP, Vista and Windows 7 (32 bit and 64 bit) although it must be run in 32 bit mode on 64 bit operating systems.

Note: Windows 7 (64bit). When using MSYS Windows 7 does not respond to *.bat files. Change the .bat to .cmd. In addition file names that start with "." eg .bzr cannot be renamed. The install programs seem to be able to write these files however.

The need for separate installations of most of the older dependancies like Dev-Cpp, MinGW, GNUWin32 etc is no longer needed.

TortoiseSVN-1.6.8.19260-win32-svn-1.6.11.msi into Windows (http://tortoiseSVN.net/downloads). If you have Windows 7 64 bit don't forget to get and install the 64 bit version TortoiseSVN-1.6.8.19260-x64-svn-1.6.11.msi. Next install bazaar from http://wiki.bazaar.canonical.com/Download During installation tick the bzr shell extension. NOTE: there may be a later versions. (if you want to build the latest development version)

Configuring the MSYS environment

You need to set some environment variables in the MSYS environment. Start MSYS and enter the following commands.

If you installed packages listed above in non-standard locations (or with different versions which are expressed in the path to the files), you'll need to modify this command appropriately:

When Building with Qt the following paths are best added to the "Path" of the environment variables of your operating system manually. Control panel – System – advanced – environment variables. (use your system drive for "C:")

Note: to avoid secondary paths to older versions of the dependencies it is safer to remove the paths from the environment variables that call "dev-cpp"

Getting the source code

Release versions

You can download the source code for the release versions from the sourceforge download area. Save the file to the /home/YOURUSERNAME directory within MSYS (typically this is C:\msys\1.0\home\YOURUSERNAME\ within the Windows filesystem). The file name should be stellarium-0.10.6.tar.gz or similar.

De-compress the tar file like this:

tar zxvf stellarium-0.10.6.tar.gz

The root of the source tree will be will be /home/YOURUSERNAME/stellarium for simplicity

Development versions from the Bazaar repository

You can try the latest development code by downloading from the bzr repositry using the TortoiseSVN client bzr shell. This program integrates with the Windows file browser. See the TortoiseSVN website for details. Check out the source by entering the folder where you have the stellarium source code and from the Windows menu bar:

Files - TortoiseBZR - update. The default will be the working tree then press enter

Check out to the /home/YOURUSERNAME directory within MSYS (typically this is C:\msys\1.0\home\YOURUSERNAME\ within the Windows filesystem).

The root of the source tree will be /home/YOURUSERNAME/stellarium

Building

Open an MSYS console, and change directory into the root of the source tree, e.g.

cd stellarium

make a build directory and change into it:

mkdir -p builds/msys && cd builds/msys

run CMake:

cmake -G "MSYS Makefiles" ../..

See the notes below for solutions to some common errors

run make:

make && echo "BUILD WORKED" || echo "BUILD FAILED"

There will be quite a few warnings. These can usually be ignored. You will see a message, "BUILD WORKED" or "BUILD FAILED" telling you if it was successful.

Doing a test run

If the build was successful, you can run the program without installing it, just to test everything is OK. First you need to find all the DLLs which Stellarium uses, and copy them to the root of the source tree:

Making the installer

If you have followed the above procedure the current svn build will generate the necessary stellarium.iss file. Double click on it, then from the menu bar "build-compile". It will build the stellarium installer package and place it in a folder of the stellarium source tree root folder "installers"

Run the program generated and Stellarium will be installed in program files\stellarium or wherever you select and place an icon on the desktop.

NOTES:

Note 1: If the compile fails with the error "can't find a particular file". Check the cmakecache.txt file in the ...\build\msys folder and make sure the variable/path/file is directed to the correct source.

Note 2: If you needed to upgrade to Qt/4.7.2 delete the contents of the old builds/msys folder before starting the compile. In fact it is always best to delete the contents of the builds/msys folder with any change to the dependancies.

Note 3: Some builds cannot find libintl.h for simplicity make a copy of dev-cpp\include\libintl.h and place it in stellarium\src\external

Note 4: Stellarium is compiled to specifically use OpenGl2 for enhanced video. If your video card does not have OpenGl2 compatable drivers you can force OpenGL1 by placing
use_qpaintenginegl2 = false in the [main] section of the config.ini file

Building with Microsoft Visual Studio 8.0

NOTE: these instructions are quite out of date.

After couple of weeks work I finally got the stellarium compiled and run using MS VisualStudio 8.0. MS C/C++ compiler is quite strict with the declarations of the variables and there is some differences with the functions that MS has/has not, but finally I got it work. A huge patch is posted to Fabien, waiting it to be approved ...

Use SVN to get the source code

Install development tools as described above, including Tortoise SVN (requires reboot)

Start MSYS. This will create the directory

C:\msys\1.0\home\<yourusername>

Browse there with file explorer.

Right click in the folder and select SVN Checkout from the popup menu

In the URL of Repository edit box, enter the URL of the SVN repository, which is