Windows Build Instructions

(Difference between revisions)
Jump to: navigation, search
m
m (Step 2: MinGW and Qt SDK)
(26 intermediate revisions by 5 users not shown)
Line 5: Line 5:
  
 
==Building with Qt Creator (Prefered method) ==
 
==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.  
 
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.  
Line 24: Line 26:
 
Go to the [[Bzr checkout|Bazaar checkout instructions]] first.
 
Go to the [[Bzr checkout|Bazaar checkout instructions]] first.
  
1- Install a SVN command line client: CollabNet Subversion
+
===Step 1: SVN client===
 +
Install a SVN command line client: CollabNet Subversion Note: This method is no longer applicable since the code is stored in Bazzar. See STEP 7
 +
 
 +
 
 
Command-Line Client works fine.
 
Command-Line Client works fine.
 
To get this you will need to register and download  
 
To get this you will need to register and download  
Line 31: Line 36:
 
Run this and install it in your preferred location or use the default
 
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.1) SDK (includes Qt libraries,  Mingw, gdb, Qt Creator) from http://qt.nokia.com and install it.
+
===Step 2: MinGW and Qt SDK===
Remove any earlier version first
+
At the moment the 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.
  
I installed it to C:\Qt\4.7.1 rather than the default location of C:\Qt\2010.05
+
  Qt libraries 4.8.2 for Windows (MinGW 4.4, 318 MB)
  
 +
from http://qt-project.org/downloads#qt-lib . Remove any earlier version first.
 +
 +
Next we will need the version of MinGW that contains Gettext and libintl versions 0.18.1.1-2. The easiest way to install MinGW and its components is to use mingw-get ([http://sourceforge.net/projects/mingw/files/latest/download download the latest mingw-get]).
  
3- Download and install cmake 2.8 from http://www.cmake.org
+
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, Libiconv, 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.  
and install it. Remove any earlier versions first
+
  
4- For Qt Creator/cmake to find the mingw environment you now need to
+
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.  
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;
+
MinGW needs to be installed before any other dependencies as it location must be known by Qt and Msys.
C:\Qt\4.7.1\mingw\lib;C:\Qt\4.7.1\mingw\include
+
 +
As of build #5572 you will need the updated version of Glext.h from the OpenGL site
 +
http://www.opengl.org/registry/api/glext.h and install it in Mingw\include\gl in lieu of the existing version. Note: This may not be necessary with later updates.
  
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.
+
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.
  
You need to (re)start Qt Creator after this.
 
  
 +
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
  
5.1- Gettext: Download the "Complete package, except sources"
+
Note: Qt 4.8.2 installation will emit a warning that only MinGW w32api.h version
installer from http://gnuwin32.sourceforge.net/packages/gettext.htm
+
3.13 is supported. Our new version is 3.17 (newer), and you can safely
and install it in C:\Qt\4.7.1\mingw\ It will install everything we
+
ignore the warning and continue.
need in the mingw environment.
+
  
 +
===Step 3: CMake===
 +
Download cmake 2.8 from http://www.cmake.org
 +
and install it. Remove any earlier versions first
  
5.2- libIconv: Download the "Complete package, except sources"
+
===Step 4: MinGW===
installer from http://gnuwin32.sourceforge.net/packages/libiconv.htm
+
For Qt Creator/cmake to find the mingw environment you now need to
and install it in C:\Qt\4.7.1\mingw\ It will install everything we
+
add some directories to your path. Assuming you installed everything
need in the mingw environment.
+
in the location C:\Qt\4.8.2 you should add in your path:
 +
 
 +
C:\Qt\4.8.2;C:\Qt\4.8.2\qt\bin;C:\Qt\4.8.2\mingw\bin;C:\Program Files\CMake 2.8\bin;
 +
C:\Qt\4.8.2\mingw\lib;C:\Qt\4.8.2\mingw\include
 +
 
 +
Note: Make sure there is no path to any previous locations of the older versions of gettext, libintl, libiconv-2. Typically in \Program Files\GnuWin32 or \DevCpp from earlier dependencies.
 +
 
 +
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.
  
 +
Gettext, libintl and libiconv will be installed as part of the new MinGW environment.so you will only need zlib
  
5.3- zlib: Download the "Complete package, except sources" installer
+
===Step 5: Zlib===
 +
zlib: Download the "Complete package, except sources" installer
 
from http://gnuwin32.sourceforge.net/packages/zlib.htm and install it
 
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
+
in C:\Qt\4.8.2\mingw\ It will install everything we need in the
 
mingw environment.
 
mingw environment.
  
  
6- Create a folder “\prog\ before you start Qt creator.
+
===Step 6: Folder for build===
 +
Create a folder “\prog\ before you start Qt creator.
 
Start Qt Creator and tell it where your svn.exe is in
 
Start Qt Creator and tell it where your svn.exe is in
 
Tools/Options../Version Control/Subversion.
 
Tools/Options../Version Control/Subversion.
Line 76: Line 97:
 
My program automatically installed in /program files/Collabnet/subversion Server
 
My program automatically installed in /program files/Collabnet/subversion Server
  
7- Create a new project File/New File or Project/Version
+
===Step 7: Fetch source code===
 +
Create a new project File/New File or Project/Version
 
Control/Subversion Checkout, and give the following url:
 
Control/Subversion Checkout, and give the following url:
  
Line 85: Line 107:
  
  
8- Once the source code is checked out, Qt Creator automatically
+
===Step 8: Configure===
 +
Once the source code is checked out, Qt Creator automatically
 
detects a cmake-based project and launches the CMake Wizard. I tell it
 
detects a cmake-based project and launches the CMake Wizard. I tell it
 
to build stellarium in C:\prog\stellarium\qtcreator-build .(default location)
 
to build stellarium in C:\prog\stellarium\qtcreator-build .(default location)
Line 94: Line 117:
  
  
9- If everything went well, click on the "build all" button in Qt
+
===Step 9: Building===
 +
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
 
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.
 
may show many warning messages. Watch the progress "build" bar in the left menu column.
Line 101: Line 125:
 
(warning messages that don't stop the build or major reasons that do).
 
(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.
 
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
 
  
libgcc_s_dw2-1.dll....from qt/4.7.0/qt/bin
+
The Dll's should be found OK if the path is set correctly but it is often better to go to the Qt\4.8.2 and \Mingw folders and copy them from the following sources.
 +
 
 +
libgcc_s_dw2-1.dll....from qt/4.8.2/MinGW/bin
 +
 
 +
libiconv2.dll....from qt/4.8.2/mingw/bin
  
libiconv2.dll....from qt/4.7.1/mingw/bin
+
libintl3.dll....from qt/4.8.2/mingw/bin
  
libintl3.dll....from qt/4.7.1/mingw/bin
+
zlib1.dll .... from qt/4.8.2/mingw/bin
  
zlib1.dll .... from qt/4.7.1/mingw/bin
+
mingwm10.dll....from qt/4.8.2/mingw/bin
  
mingwm10.dll....from qt/4.7.1/qt/bin
+
libstdc++.dll.... from qt/4.8.2/mingw/bin
  
phonon4.dll....from qt/4.7.1/qt/bin
+
phonon4.dll....from qt/4.8.2/qt/bin
  
Qtcore4.dll....from qt/4.7.1/qt/bin
+
Qtcore4.dll....from qt/4.8.2/qt/bin
  
Qtgui4.dll....from qt/4.7.1/qt/bin
+
Qtgui4.dll....from qt/4.8.2/qt/bin
  
Qtnetwork4.dll....from qt/4.7.1/qt/bin
+
Qtnetwork4.dll....from qt/4.8.2/qt/bin
  
Qtopengl4.dll....from qt/4.7.1/qt/bin
+
Qtopengl4.dll....from qt/4.8.2/qt/bin
  
Qtscript4.dll....from qt/4.7.1/qt/bin
+
Qtscript4.dll....from qt/4.8.2/qt/bin
  
Qtsvg4.dll....from qt/4.7.1/qt/bin
+
Qtsvg4.dll....from qt/4.8.2/qt/bin
  
Qtxml4.dll....from qt/4.7.1/qt/bin
+
Qtxml4.dll....from qt/4.8.2/qt/bin
  
 
To the stellarium folder
 
To the stellarium folder
Line 141: Line 168:
 
==Making the Package==
 
==Making the Package==
  
To make an intallation package you will first need to download and install the Inno installer
+
To make an installation 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.  
 
From http://www.jrsoftware.org download isetup-5.2.3.exe, run it to install.  
Line 151: Line 178:
 
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.
 
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.
+
The package will be built and placed in a new folder created "installers". The package will be "stellarium-0.11.4-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.

Revision as of 13:46, 20 September 2012

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


Contents

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.

http://www.microsoft.com/windows/win...s-xp-mode.aspx

http://www.microsoft.com/windows/vir.../download.aspx

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.

Step 1: SVN client

Install a SVN command line client: CollabNet Subversion Note: This method is no longer applicable since the code is stored in Bazzar. See STEP 7


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

Step 2: MinGW and Qt SDK

At the moment the 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-project.org/downloads#qt-lib . Remove any earlier version first.

Next we will need the version of MinGW that contains Gettext and libintl versions 0.18.1.1-2. The easiest way to install MinGW and its components is to use mingw-get (download the latest mingw-get).

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, Libiconv, 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.

As of build #5572 you will need the updated version of Glext.h from the OpenGL site http://www.opengl.org/registry/api/glext.h and install it in Mingw\include\gl in lieu of the existing version. Note: This may not be necessary with later updates.

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

Note: Qt 4.8.2 installation will emit a warning that only MinGW w32api.h version 3.13 is supported. Our new version is 3.17 (newer), and you can safely ignore the warning and continue.

Step 3: CMake

Download cmake 2.8 from http://www.cmake.org and install it. Remove any earlier versions first

Step 4: MinGW

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.8.2 you should add in your path:

C:\Qt\4.8.2;C:\Qt\4.8.2\qt\bin;C:\Qt\4.8.2\mingw\bin;C:\Program Files\CMake 2.8\bin; 
C:\Qt\4.8.2\mingw\lib;C:\Qt\4.8.2\mingw\include

Note: Make sure there is no path to any previous locations of the older versions of gettext, libintl, libiconv-2. Typically in \Program Files\GnuWin32 or \DevCpp from earlier dependencies.

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.

Gettext, libintl and libiconv will be installed as part of the new MinGW environment.so you will only need zlib

Step 5: Zlib

zlib: Download the "Complete package, except sources" installer from http://gnuwin32.sourceforge.net/packages/zlib.htm and install it in C:\Qt\4.8.2\mingw\ It will install everything we need in the mingw environment.


Step 6: Folder for build

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

Step 7: Fetch source code

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 .


Step 8: Configure

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.


Step 9: Building

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.

The Dll's should be found OK if the path is set correctly but it is often better to go to the Qt\4.8.2 and \Mingw folders and copy them from the following sources.

libgcc_s_dw2-1.dll....from qt/4.8.2/MinGW/bin

libiconv2.dll....from qt/4.8.2/mingw/bin

libintl3.dll....from qt/4.8.2/mingw/bin

zlib1.dll .... from qt/4.8.2/mingw/bin

mingwm10.dll....from qt/4.8.2/mingw/bin

libstdc++.dll.... from qt/4.8.2/mingw/bin

phonon4.dll....from qt/4.8.2/qt/bin

Qtcore4.dll....from qt/4.8.2/qt/bin

Qtgui4.dll....from qt/4.8.2/qt/bin

Qtnetwork4.dll....from qt/4.8.2/qt/bin

Qtopengl4.dll....from qt/4.8.2/qt/bin

Qtscript4.dll....from qt/4.8.2/qt/bin

Qtsvg4.dll....from qt/4.8.2/qt/bin

Qtxml4.dll....from qt/4.8.2/qt/bin

To the stellarium folder

10. Run Stellarium and enjoy

Installing Stellarium

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 installation 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.11.4-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.

Personal tools
Namespaces
Variants
Actions
in this wiki
other languages
Toolbox