Microsoft Windows Builds

From Second Life Wiki
Jump to navigation Jump to search


On Windows, there are several options on build (compile) environment of the Second Life.

This page explains how you can compile the viewer on Microsoft Windows. As of 1.21, Lindens are using Visual Studio 2005, but other compilers can be used.

Currently, only 32 bit binary is tested. There seems to be several trials to produce 64 bit Windows .EXE of the viewer. If you did, please write your experience on this wiki (regardless it was successful or not!)

The following explanation is adjusted for Viewer releases 1.16.0.5 and beyond. See an older version of this page for the Viewer releases 1.15 or before.

Choosing and Preparing a Compiler

Linden-Supported Compilers

Supported compiler:

  • Latest releases (1.21 and later):
    • Visual Studio .NET 2005 Professional
  • Older releases (1.20 and earlier)

You need to setup the compiler and Microsoft Development tools as follows:

Community Experimental Compilers

  • Visual C++ 2005 Express ===
  • Visual Studio 2008 needs some work:
    • Visual Studio 2008
    • Visual C++ 2008 Express

Instructions: Compiling the Viewer (MSVS2008).

Cross compiling with gcc on Linux

mingw needs some work:

  • i686-mingw

Old contributed build instructions are on: User:Dzonatas Sol/Cross compiling the viewer (i686-mingw32).

Getting other Development Tools

You will also need some open source development tools.

  • Cygwin
    • When you run the cygwin setup utility make sure you have selected to install patchutils, flex, and bison (all located under "devel") which are not part of the default install. (If you missed one of these, the easiest thing to do is to re-run the entire installation.) Older releases (< r79209) had several hardcoded references that expect Cygwin to be installed at C:\cygwin in the project files, however current releases rely on the build environment configuration instead.
  • ActivePython 2.3x or later - Latest Version seems to be 2.5.2.2. Compatibility with SL is unsure.
    • It is required but can be avoided if you are compiling 1.18 or later viewers. Either download and install or hack the prebuild.bat files as described in VWR-1267.
  • ActivePerl was recommended for previous versions on this Wiki, but it currently appears, that it is not strictly necessary unless you are planning to build your own version of all libraries (which most likely you don't want to do). So for a start it may be safe to skip it.
    ActivePerl

Downloading Source Code

You can download the Viewer source cods on the source downloads page. You can also use a version control repository. If you're just starting out, it's probably best to get the latest Release version, rather than a Release Candidate, because the Release Candidates get updated quite often. But if you would rather not run across bugs that have already been fixed, go for the version control repository Trunk branch.

If you're downloading from the source downloads page, there are three packages to get: the source package, the artwork package, and the library package. In versions 1.20 and earlier, Linden packaged the library binaries in the Libs package; for 1.21 and beyond, only the fonts are there.

For 1.21 and beyond, the CMake develop.py script now downloads the libraries that were previously in the libs zip file. This saves developers who are tracking trunk from constantly downloading them every update and only downloads updated libraries.

For 1.20 and before, many of the libraries can either be compiled from source or downloaded from other sites (see below), but this will take hours and thus it is easiest to also get the package with libraries compiled by the Lindens.

WARNING:

  • If the directory path you keep the SL source in has a space in it, the batch file that copies message_template.msg will fail. So, if you unzip or checkout the source tree into, e.g., "C:\Projects\Dir with space in name\Etc\linden", it won't work!
  • You should also avoid using non-ASCII (national) characters in the paths, although some localized versions of the tool puts some as a default...
  • Unzip or checkout your source tree into a directory that has as short full pathname as possible, since long paths cause some unexpected trouble during the build.

In other words, the easiest way to get this working is to get Source: Windows (CRLF), Source: Artwork and Libs: Windows from the source downloads page and unpack them all into the same directory/folder, which ideally would be a folder in (or near) the root directory with a short name like sl_1_21_6.

Installing Libraries

SL Viewer depends on some third party libraries. Some of them are open source, some others are not.

Open Source Libraries

You can download the pre-build open source libraries from LL. For versions 1.20 and earlier, they are available on the source downloads page. Unzip them into your SL viewer source code directory, maintaining the same directory structure.

Note: The VS2003 libraries provided in the source downloads do not fully work with VS2005 compiled binaries. They will compile with the viewer under VS2005, but the VS2003 libraries are not fully STL compliant. The differences of non-standard behavior in MSVS are the known cause.

The VS2003 libraries have vc71 in their names; the VS2005 libraries have vc80 in their names.

Alternatively, it may be possible to get the source files for the libraries and build by yourself. See the instruction for VS2003 users if you try it. Please note, however, it is not known that VS2005 can successfully compile the libraries. You have been warned. (If you can make it, please write the info on this wiki...)

Proprietary Libraries

Linden does not include the following proprietary libraries. You will need to follow the instructions to acquire below and copy them to the source path.

However, it probably is a good idea to build an empty directory tree for the files below and first copy the files there and once completed, copy the whole tree to the actual source folder (like XCOPY OLIB SL_1_16_0_5 /S). The reason is, that these steps are cumbersome and will have to be repeated for each new release (at least if you keep the source for each release in it's own folder). If you do not want to do this, of course you can just copy the files directly into the linden source paths.

rem OLIBS.CMD to build a folder tree for 3rd party libraries and includes
md olibs
md olibs\linden\
md olibs\linden\libraries
md olibs\linden\libraries\include
md olibs\linden\libraries\i686-win32
md olibs\linden\libraries\i686-win32\lib_release
md olibs\linden\libraries\i686-win32\lib_debug
md olibs\linden\libraries\i686-win32\include
md olibs\linden\libraries\i686-win32\include\GL
md olibs\linden\libraries\i686-win32\include\quicktime
md olibs\linden\indra
md olibs\linden\indra\newview


Fmod

  • Download & extract fmod 3.75 api for win32, under section heading FMOD 3 Programmers API (later versions, like FMOD Ex, are incompatible).
  • Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include"
  • Copy "fmodapi375win\api\inc\fmod_errors.h" to "linden\libraries\include"
  • Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib_release" and to "linden\libraries\i686-win32\lib_debug"

(If using cmake, copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug")

  • Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview"


Quicktime

Currently - as of version 1.21 - CMake requires Quicktime to be installed.

Note: This download requires a registration at the Apple Quicktime website and take a bit of time. You can avoid using QuickTime if you want, see this for details. Remember that your viewer can't play in-world movies if you do so.

  • Download & install the Quicktime SDK for Windows
  • Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_release" and to "linden\libraries\i686-win32\lib_debug".

(If using CMake, copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib\release" and to "linden\libraries\i686-win32\lib\debug" instead)

  • Copy the contents of "QuicktimeSDK\CIncludes" into "linden\libraries\i686-win32\include\quicktime".

Next steps

CMake

At this point, you should be ready to use CMake. See Building the viewer with CMake and follow the instructions there. NOTE: CMake is only supported for viewer versions 1.21 and beyond.

Build instructions for 1.20 and earlier

See Compiling older viewers (1.20 and earlier with MSVS) if you'd like to compile a version of the viewer older than 1.20.