Difference between revisions of "Compiling the viewer (MSVS2003)"

From Second Life Wiki
Jump to navigation Jump to search
m (→‎Libraries: Used #xxx style links for intra page linking.)
(inserted section headers, shuffled stuff around a bit, clarified some instructions)
Line 5: Line 5:
If you get lost, or these instructions are incomplete, see [[communication tools]] for a list of ways to get in touch with people that can help.
If you get lost, or these instructions are incomplete, see [[communication tools]] for a list of ways to get in touch with people that can help.


=== Windows ===
== Development Environment ==
==== Development Environment ====
The following dev environment is what LL uses for Windows development.  There is no reason that the Second Life viewer can not be built using other environments, but it will take some extra work.
The following dev environment is what LL uses for Windows development.  There is no reason that the Second Life viewer can not be built using other environments, but it will take some extra work.


(Instructions for building the viewer using Microsoft's Visual Studio .NET 2005 Express can be found [[Compiling the viewer (MSVS2005)|on another page]]. At the time of writing, Express was freely available.)
(Instructions for building the viewer using Microsoft's Visual Studio .NET 2005 Express can be found [[Compiling the viewer (MSVS2005)|on another page]]. At the time of writing, Express was freely available.)


* Visual Studio .NET 2003 Professional
=== Visual Studio .NET 2003 Professional ===
** [http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en Microsoft Platform SDK]
** [http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en Microsoft Platform SDK]
** A DirectX 9.0 SDK released on or after Summer of 2003 [http://download.microsoft.com/download/5/1/f/51ff8357-0af3-418b-9d0b-e9a5cdc39759/dxsdk_dec2006.EXE DirectX 9.0 SDK (December 2006)] [http://www.microsoft.com/downloads/details.aspx?FamilyID=9216652f-51e0-402e-b7b5-feb68d00f298&displaylang=en DirectX 9.0 SDK Update (Summer 2003)]
** A DirectX 9.0 SDK released on or after Summer of 2003 [http://download.microsoft.com/download/5/1/f/51ff8357-0af3-418b-9d0b-e9a5cdc39759/dxsdk_dec2006.EXE DirectX 9.0 SDK (December 2006)] [http://www.microsoft.com/downloads/details.aspx?FamilyID=9216652f-51e0-402e-b7b5-feb68d00f298&displaylang=en DirectX 9.0 SDK Update (Summer 2003)]
Line 20: Line 19:
*** Make sure that the '''includes''' and '''libraries''' paths have the the Platform SDK paths first, then the DirectX SDK paths, and then the Visual C++ paths.
*** Make sure that the '''includes''' and '''libraries''' paths have the the Platform SDK paths first, then the DirectX SDK paths, and then the Visual C++ paths.
*** If the DirectX SDK paths aren't present, add them to both '''includes''' and '''libraries'''.
*** If the DirectX SDK paths aren't present, add them to both '''includes''' and '''libraries'''.
*** Later versions of the DirectX SDK have two lib directories -- with those select ''lib/x86'', not just ''lib''
=== Other Development Tools ===
* [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython 2.3x]
* [http://www.activestate.com/Products/ActivePython/?mp=1 ActivePython 2.3x]
* [http://www.activestate.com/Products/ActivePerl/?mp=1 ActivePerl]
* [http://www.activestate.com/Products/ActivePerl/?mp=1 ActivePerl]
Line 25: Line 27:
** When you run the cygwin setup utility make sure you have selected to install patchutil, flex, and bison (all located under "devel") which are not part of the default install. '''note:''' when installing cygwin, be sure to install in the default directory. Otherwise, you will have to modify the "lscript_compile_fb.vproj" file to point to the right locations.
** When you run the cygwin setup utility make sure you have selected to install patchutil, flex, and bison (all located under "devel") which are not part of the default install. '''note:''' when installing cygwin, be sure to install in the default directory. Otherwise, you will have to modify the "lscript_compile_fb.vproj" file to point to the right locations.


==== Libraries ====


If you have downloaded the library directory from LL, extract it, and copy the files to your code directory, maintaining the same directory structure.  We have included all the libraries we can ship in this file, but we can not distribute the source to the following , and you will need to follow the instructions to acquire below:
== Source Code ==
* [[#Fmod|Fmod]]
 
* [[#gl|gl]]
The easiest way to get this working is to get ''source'', ''artwork'' and ''libraries'' 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_16_0_5''.
* [[#Quicktime|Quicktime]]
 
 
== Open Source Libraries ==
 
Some libraries can be distributed with the SL source and there is a library package available with the source.  As mentioned above (about the source), you can simply extract the library archive and copy the files to your code directory, maintaining the same directory structure.   
 
If instead you are interested in compiling these libraries from source instead of using the zipfile of precompiled libraries provided by Linden Lab, see [[Compiling the viewer libraries (MSVS 2003)]]
 
 
== Other Libraries ==
 
Linden Lab included all the libraries/includes they can ship with their source, but we can not distribute the source to the following , and you will need to follow the instructions to acquire below.
 
It probably is a good idea to build an empty directory tree for the files below and copy the files there and once completed, copy the tree to the actual source folder.  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, just copy the files directly into the linden source paths.


===== Fmod =====
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\GL
md olibs\linden\libraries\i686-win32\include\quicktime
md olibs\linden\indra
md olibs\linden\indra\newview
 
==== Fmod ====
* Download & extract [http://www.fmod.org/ifmoddownload.html fmod 3.75 api for win32].
* Download & extract [http://www.fmod.org/ifmoddownload.html fmod 3.75 api for win32].
* Copy "fmodapi375win\api\inc\fmod.h" to "libraries\include"
* Copy "fmodapi375win\api\inc\fmod.h" to "linden\libraries\include"
* Copy "fmodapi375win\api\inc\fmod_errors.h" to "libraries\include"
* Copy "fmodapi375win\api\inc\fmod_errors.h" to "linden\libraries\include"
* Copy "fmodapi375win\api\lib\fmodvc.lib" to "libraries\i686-win32\lib_release"
* Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib_release"
* Copy "fmodapi375win\api\lib\fmodvc.lib" to "libraries\i686-win32\lib_debug"
* Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib_debug"
* Copy "fmodapi375win\api\fmod.dll" to "indra\newview"
* Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview"


===== gl =====
==== gl ====
* Download [http://oss.sgi.com/projects/ogl-sample/sdk.html glext.h, glxext.h, and wglext.h]
* Download [http://oss.sgi.com/projects/ogl-sample/sdk.html glext.h, glxext.h, and wglext.h]
* Copy them to "libraries\i686-win32\include\GL"
* Copy them to "linden\libraries\i686-win32\include\GL"


===== Quicktime =====
==== Quicktime ====
* Download & install the [http://developer.apple.com/quicktime/download/ Quicktime SDK for Windows]
* Download & install the [http://developer.apple.com/quicktime/download/ Quicktime SDK for Windows]
* Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "\libraries\i686-win32\lib_release".
* Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_release".
* Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "\libraries\i686-win32\lib_debug".
* Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_debug".
* Copy the contents of "QuicktimeSDK\CIncludes" into "\libraries\i686-win32\include\quicktime".
* Copy the contents of "QuicktimeSDK\CIncludes" into "linden\libraries\i686-win32\include\quicktime".
 
=== Compiling Libraries from source ===


If you are interested in compiling the libraries from source instead of using the zipfile of precompiled libraries provided by Linden Lab, see [[Compiling the viewer libraries (MSVS 2003)]]


=== Building ===
== Building ==
* Open the \indra\indra_complete\indra_complete.sln solution in Visual Studio.
* Open the \indra\indra_complete\indra_complete.sln solution in Visual Studio.
* Set newview to be the startup project.
* Set newview to be the startup project.
Line 60: Line 84:
* ReleaseNoOpt offers a more debugging information.  A seperate debugging console window opens and stays open for the duration of your session.
* ReleaseNoOpt offers a more debugging information.  A seperate debugging console window opens and stays open for the duration of your session.
* This comes at a penalty of about 50% of your FPS in busy areas, compared to ReleaseForDownload build.
* This comes at a penalty of about 50% of your FPS in busy areas, compared to ReleaseForDownload build.
* Note that the ReleaseForDownload build also contains debug information and can be run in the debugger.
* newview_noopt.exe will be built in \indra\newview\ReleaseNoOpt, or
* newview_noopt.exe will be built in \indra\newview\ReleaseNoOpt, or
* SecondLife.exe will be built in \indra\newview\ReleaseForDownload
* SecondLife.exe will be built in \indra\newview\ReleaseForDownload
Line 65: Line 90:


   
   
=== Additional Steps For 1.15 ===  
== Additional Steps For 1.15 ==
There are several resource files missing from the 1.15.0.2 source code distribution that are required for building.  To fix this, download the latest 1.14 source and copy the files from linden\indra\newview\res\ into the same spot in your 1.15 distro except for the files resource.h and newViewRes.rc.  
There are several resource files missing from the 1.15.0.2 source code distribution that are required for building.  To fix this, download the latest 1.14 source and copy the files from linden\indra\newview\res\ into the same spot in your 1.15 distro except for the files resource.h and newViewRes.rc.  



Revision as of 07:59, 8 June 2007

The following instructions are for compiling the Second Life viewer on Windows for Visual Studio .Net 2003. If you are using more recent versions of Visual Studio, see Compiling the viewer (MSVS2005). For other platforms including MacOS and Linux, see Compiling the viewer.

If you get lost, or these instructions are incomplete, see communication tools for a list of ways to get in touch with people that can help.

Development Environment

The following dev environment is what LL uses for Windows development. There is no reason that the Second Life viewer can not be built using other environments, but it will take some extra work.

(Instructions for building the viewer using Microsoft's Visual Studio .NET 2005 Express can be found on another page. At the time of writing, Express was freely available.)

Visual Studio .NET 2003 Professional

    • Microsoft Platform SDK
    • A DirectX 9.0 SDK released on or after Summer of 2003 DirectX 9.0 SDK (December 2006) DirectX 9.0 SDK Update (Summer 2003)
      • Note: If you have previously installed an older version of the DirectX 9.0 SDK, remove it first (from Control Panel -> Add or Remove Programs) before installing this version. Installing the new SDK "on top" of an older version may cause problems.
    • Set up the project globals:
      • Start Visual C++
      • Go to Tools/Options/Projects/VC++ Directories
      • Make sure that the includes and libraries paths have the the Platform SDK paths first, then the DirectX SDK paths, and then the Visual C++ paths.
      • If the DirectX SDK paths aren't present, add them to both includes and libraries.
      • Later versions of the DirectX SDK have two lib directories -- with those select lib/x86, not just lib

Other Development Tools

  • ActivePython 2.3x
  • ActivePerl
  • Cygwin
    • When you run the cygwin setup utility make sure you have selected to install patchutil, flex, and bison (all located under "devel") which are not part of the default install. note: when installing cygwin, be sure to install in the default directory. Otherwise, you will have to modify the "lscript_compile_fb.vproj" file to point to the right locations.


Source Code

The easiest way to get this working is to get source, artwork and libraries 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_16_0_5.


Open Source Libraries

Some libraries can be distributed with the SL source and there is a library package available with the source. As mentioned above (about the source), you can simply extract the library archive and copy the files to your code directory, maintaining the same directory structure.

If instead you are interested in compiling these libraries from source instead of using the zipfile of precompiled libraries provided by Linden Lab, see Compiling the viewer libraries (MSVS 2003)


Other Libraries

Linden Lab included all the libraries/includes they can ship with their source, but we can not distribute the source to the following , and you will need to follow the instructions to acquire below.

It probably is a good idea to build an empty directory tree for the files below and copy the files there and once completed, copy the tree to the actual source folder. 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, 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\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.
  • 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"
  • Copy "fmodapi375win\api\lib\fmodvc.lib" to "linden\libraries\i686-win32\lib_debug"
  • Copy "fmodapi375win\api\fmod.dll" to "linden\indra\newview"

gl

Quicktime

  • Download & install the Quicktime SDK for Windows
  • Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_release".
  • Copy "QuicktimeSDK\Libraries\QTMLClient.lib" to "linden\libraries\i686-win32\lib_debug".
  • Copy the contents of "QuicktimeSDK\CIncludes" into "linden\libraries\i686-win32\include\quicktime".


Building

  • Open the \indra\indra_complete\indra_complete.sln solution in Visual Studio.
  • Set newview to be the startup project.
  • Build either ReleaseNoOpt (for debugging) or ReleaseForDownload (for production).
  • ReleaseNoOpt offers a more debugging information. A seperate debugging console window opens and stays open for the duration of your session.
  • This comes at a penalty of about 50% of your FPS in busy areas, compared to ReleaseForDownload build.
  • Note that the ReleaseForDownload build also contains debug information and can be run in the debugger.
  • newview_noopt.exe will be built in \indra\newview\ReleaseNoOpt, or
  • SecondLife.exe will be built in \indra\newview\ReleaseForDownload
  • create a shortcut to newview_noopt.exe or secondlife.exe, and change the start location to \indra\newview\ (all the .dll will be found there.)


Additional Steps For 1.15

There are several resource files missing from the 1.15.0.2 source code distribution that are required for building. To fix this, download the latest 1.14 source and copy the files from linden\indra\newview\res\ into the same spot in your 1.15 distro except for the files resource.h and newViewRes.rc.

Several files are also missing which are needed for running the program after it has been built:

  • Copy static_index.db2 and static_data.db2 from C:\Program Files\SecondLife\app_settings\ into linden\indra\newview\app_settings\.
  • Copy the character and skins folder located in c:\program files\secondlife\ into your distro's linden\indra\newview\ folder being careful not to overwrite any files that have a newer version.
  • nss3.dll, smime3.dll, softokn3.dll, and ssl3.dll must be copied from c:\program files\secondlife into linden\indra\newview\.