Celestia/Development/Win32 platform

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Celestia development options using Windows-32 software packages:

Contents

[edit] Subversion (svn)

Celestia's source code is available on a Subversion (SVN) repository hosted on SourceForge.

Several Subversion clients are available for Windows. A very popular one is TortoiseSVN, a Windows shell extension that lets you use SVN commands right from Windows Explorer. A command line version is available with Cygwin.

To get the latest Celestia source using the with the command line client:

svn co https://celestia.svn.sourceforge.net/svnroot/celestia/trunk

With Tortoise SVN, select 'Checkout' from the Windows Explorer popup menu, and then enter the URL:

https://celestia.svn.sourceforge.net/svnroot/celestia/trunk

[edit] Microsoft C++ & SDK tools for Windows XP

In order to build software for Windows, you need both an SDK (Software Development Kit) and a compiler. The SDK provides libraries and include files needed for building for a particular version of Windows. The compiler converts text files into binary programs, linking them to the SDK libraries. Microsoft provides free versions of their SDKs and compilers, although with limited features, in order to encourage development of software for use with their operating systems. They also sell enhanced versions for use by commercial software development organizations.

[edit] VS2008

In December 2007, Microsoft released Visual C++ 2008 Express Edition, the latest version of their free C++ development environment. As of Celestia version 1.6.0, this is the only version of the compiler recommended for building Celestia. Note that Visual C++ 2008 will not run on Windows 98. For this reason only, you may want to use Visual Studio 2005. If you have a Windows 2000, XP, or Vista, compiling is much easier with Visual C++ 2008.

  • If you do not already have Microsoft Visual C++ 2008, you may download it for free from here
http://www.microsoft.com/express/download/default.aspx
  • You will also need the Windows SDK, also a free download from Microsoft:
http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en

[edit] Step by step instructions for Visual C++ 2008 Express Edition

This process assumes that you've followed the steps above, checked out the source from SVN, and installed the Visual C++ compiler and Windows SDK.

  1. Copy iconv.dll, intl.dll and lua5.1.dll from windows\dll\x86 into the celestia directory.
  2. Open celestia.sln in Microsoft Visual C++.Net 2008 and allow the updater to work.
  3. Set the build type to "Release".
  4. Build!

[edit] VS2005

Recommended only for users of Windows 98/ME, where the Visual C++ 2008 is not supported. If you are running XP or Vista, you should use the much easier proces described in the previous section.

  • Windows Platform SDK: Web Install
http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en
  • Windows Platform SDK: disk image
http://www.microsoft.com/downloads/details.aspx?FamilyID=e15438ac-60be-41bd-aa14-7f1e0f19ca0d&DisplayLang=en
  • Visual Studio 2005 Express C++: Web install
http://www.microsoft.com/express/2005/download/default.aspx
  • Visual Studio 2005 Express C++: disk image
http://msdn2.microsoft.com/en-us/express/aa718401.aspx


[edit] Celestia libraries for VS2005

The libraries in the Celestia repository were built with VS2008, and will not work on Windows 98/ME:

Celestia Libraries for Visual Studio 2005 Express:

http://www.shatters.net/~claurel/celestia/winbuild/
  • As of October, 2007, use
    • cspice.lib
    • winbuild-2.zip
    • winlibs-2.zip
Several source code files have been added to Celestia's svn repository since winbuild-2.zip was created. Insert these lines into the OBJS section of celestia/src/celengine/engine.mak if you're using makerelease.bat to build from the current subversion repository:
       $(INTDIR)\axisarrow.obj \
       $(INTDIR)\customrotation.obj \
       $(INTDIR)\frametree.obj \
       $(INTDIR)\precession.obj \
       $(INTDIR)\scriptrotation.obj \ 
       $(INTDIR)\timeline.obj \
       $(INTDIR)\timelinephase.obj \
The SPICE include files are included in winlibs-2.zip.
No binary DLLs (Dynamically Loaded Libraries) are included in these Zip files, so you'll have to get them from one of the precompiled Celestia installation kits. As of January 26, 2008, use the DLLs which are included in Celestia v1.5.0. The official release of Celestia v1.5.0 is available on SourceForge.


The version of Celestia that's included in the Windows Celestia distribution kits is compiled using the script makerelease.bat. The older VS2003 versions of the build scripts are still what are in the cvs archive on SourceForge. The makefiles and .bat scripts which have been updated for VS2005/VS2008 are included in winbuild-2.zip [Remark: There is no makerelease.bat in winbuild-2.zip], which is in the VS2005 winbuild directory shown above.

Don't forget that you'll have to configure the PATH, LIB and INCLUDE environment variables according to your particular development environment so that the build scripts will find the Visual Studio and Celestia programs, include files and libraries.

Here's one example .BAT script for defining the search lists. It probably won't work for you: you probably have put the files in different directories. Change it appropriately.

Set INCLUDE=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include;%INCLUDE%
Set INCLUDE=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include\mfc;%INCLUDE%
Set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;%INCLUDE%
Set INCLUDE=C:\cvs\Celestia\celestia\inc;%INCLUDE%

Set PATH=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin;%PATH%
Set PATH=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;%PATH%
Set PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin;%PATH%

Set LIB=C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib;%LIB%
Set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;%LIB%
Set LIB=C:\cvs\Celestia\celestia\lib;%LIB%