Compiling older viewers (1.20 and earlier with MSVS)
This page contains instructions for compiling older versions of the Second Life viewer (1.20 and earlier).
Configuring the build environment
See Compiling the viewer (MSVS2005) for instructions on configuring the MSVS build environment. The instructions on this page are apply after the build environment is configured.
Using pre-built solution/project files
For versions of the viewer older than 1.20, here is a ZIP file with solution/project files available on the JIRA bug tracker issue VWR-1151.
If you are building 1.16 or later, the easiest way towards compiling SL on MS2005 will be to use the zip file mentioned above. The details is as follows:
- Download the appropriate ZIP archive from JIRA.
- Unpack it and copy it onto your linden source tree (allow to overwrite files that have _vc8 in the name).
- Start Visual Studio 2005 (or VC++ Express).
- Use "File > Open > Project/Solution" to open the linden\indra\indra_complete\indra_complete_vc8.sln (Note: If you plan to work with multiple versions over time, you will find it useful to rename indra_complete_vc8.sln to something which contains the version number, e.g. indra_1_17_0_11_vc8.sln before opening.)
- Right click newview in the frame Solution Explorer and click "Set as StartUp Project".
- Proceed with applying the Workarounds below (skip Manual conversion).
Note: The solution/project files depends on the viewer release version. If you are compiling some specific version of the viewer, and thedoesn't list the zip file for you version, you can try using the most close one. If, while compiling, you later encounter errors or problems regarding the projects, you may have to do the manual conversion instead.
Note: If you don't find a matching solution or if it does not work right away, try the manual conversion (see below) because most likely it will be quicker than trying to figure out what's wrong with someone else's patched files.
Manual conversion of the solution/projects
If you can not find a set of project files (see above), there are instructions available how to manually do it: Converting_project_files_for_MSVS2005 (this step will take about 5-15 minutes, depending on how proficient you are using VS2005).
There are more compatibility problems between VS2003 and VS2005. You need the following code edits.
For whatever reason, the test project doesn't work under VS2005. Workaround is to disable it as follows: Right click on the test and choose Unload Project.
If you do not plan to create a full download build, you can exclude the win_crash_logger and win_updater from newview's project dependencies and unload them also. But be careful with unloading these projects without removing them from the dependencies, because I have seen VS2005 act highly erratic while linking then project when I tried this.
If you don't want to get Apple QuickTime SDK, you can disable it as follows:
- linden\indra\llcommon\llpreprocessor.h - near line 58 (the line below #elif LL_WINDOWS)
--50: #define LL_QUICKTIME_ENABLED 1 ++50: #define LL_QUICKTIME_ENABLED 0
LearCale: this appears to be in linden\indra\llmedia\llmediabase.h as of client 1.20
- Pick ReleaseNoOpt in the Solution Configurations drop-down box beside the green arrow under the tool bar, and do the followings on the Solution Explorer frame:
- Click newview to select it alone.
- Choose Properties.
- Under Configuration Properties > Linker > Input, click Additional Dependencies on the right to show a button labeled "..." on it at the very right on the line, then click the ... button.
- Scroll down the list to find qtmlclient.lib. Delete this single line.
- Click OK to close the "Additional Dependencies" dialog, then click OK again to close the "newview Property Pages" dialog box.
- Pick ReleaseForDownload in the Solution Configurations drop-down box. Click newview to select it alone and do the same thing again.
Ready, Set, Build!
Lindens use VS2003 to develop the viewer.
To convert to MSVS2005, see Converting_project_files_for_MSVS2005.
You either need to convert solution file and project files from VS2003 format to VS2005 format or obtain files compatible with VS2005. You may also need to modify source files to work around the incompatibility between VS2003 and VS2005.
Note: linden\indra\indra_complete_vs8.sln is a solution file already included in the source archive and intended for the Visual Studio 2005, but it does not work (at least between 1.14.0 and 126.96.36.199 distribution). This may change in a future release, if Lindens include an updated versions of the _vc8 files.
- Usually you will either use ReleaseNoOpt or the ReleaseForDownload configuration.
- ReleaseNoOpt (not optimized) compiles faster and has more debugging information, but this comes at a runtime penalty of about 50% of your FPS in busy areas, compared to ReleaseForDownload build.
- ReleaseForDownload also has debugging information and runs fine in the debugger (although at times you may miss access to some local variables).
- ReleaseNoOpt comes with a seperate debugging console window opens and stays open for the duration of your session, but you can access the same information also by pressing Shift+Ctrl+4 in the viewer (all builds).
- The debug console log can also be redirected to a file if you add "2>secondlife.log" to the command line (Newview, Properties, Debugging, Command line arguments).
- If you want to build a Debug configuration, see the specific section with compile instructions on finding leaks
- Build either ReleaseNoOpt (for debugging) or ReleaseForDownload (for production code).
- To do this, pick either in the Solution Configurations drop-down box beside the green arrow under the tool bar.
- Make sure newview is set as the startup project (otherwise set from newview's right-click menu).
- Select Build-Menu > Build Solution or press F7.
- newview_noopt.exe will be built in linden\indra\newview\ReleaseNoOpt or SecondLife.exe will be linden\indra\newview\ReleaseForDownload.
- Note, that if you are building with MSVS2005 Express, you will be using the linden\indra\indra_complete\indra_complete.sln as detailed at Converting_project_files_for_MSVS2005
- You can run the viewer by Debug > Start Debugging or Debug > Start Without Debugging in Visual Studio.
- To run it outside VS, create a shortcut to SecondLife.exe, and change the start location to linden\indra\newview\ (All the .dll will be found there.)
- Alternately copy the exe (possibly rename it) to your "c:\program files\secondlife" folder.