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

From Second Life Wiki
Jump to navigation Jump to search
Line 85: Line 85:


*linden\indra\newview\llfloaterland.cpp @ line 2609, and line 2878
*linden\indra\newview\llfloaterland.cpp @ line 2609, and line 2878
--2609: S32 now = time(NULL);
++2609: S32 now = '''''(S32)'''''time(NULL);


  typecast to (S32)time(NULL)
  --2878: S32 now = time(NULL);
++2878: S32 now = '''''(S32)'''''time(NULL);


*linden\indra\newview\llfloaterbump.cpp @120
*linden\indra\newview\llfloaterbump.cpp @ line 120
  typecast to (S32)mcd->mTime
  --120: timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime);
*linden\indra\newview\viewer.cpp @2510
++120: timep = utc_to_pacific_time('''''(S32)'''''mcd->mTime, gPacificDaylightTime);
 
*linden\indra\newview\viewer.cpp @ line 2510
  srand((U32)time(NULL));
  srand((U32)time(NULL));
*linden\indra\newview\llpaneldirevents.cpp @137,169
*linden\indra\newview\llpaneldirevents.cpp @137,169
  typecast to (S32)utc_time
  typecast to (S32)utc_time

Revision as of 14:27, 9 January 2007

Introduction

By no means do I consider myself an expert. These are just the steps and fixes from myself, and the team in the irc.efnet.org channel #opensl.

Prerequisites

Basics

  • Visual Studio 2005 (May work with MC++ 2005 Express)
    • Microsoft Platform SDK
    • NEED NEWER DIRECTX 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 Microsoft Visual Studio 2005
      • Go to Tools/Options/Projects/VC++ Directories
      • Make sure that the includes(screen shot) and libraries(screen shot) paths have 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.
  • 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.

Fmod

  • Download & extract fmod 3.75 api for win32.
  • Copy "fmodapi375win\api\inc\fmod.h" to "libraries\include"
  • Copy "fmodapi375win\api\inc\fmod_errors.h" to "libraries\include"
  • Copy "fmodapi375win\api\lib\fmodvc.lib" to "libraries\i686-win32\lib_release"
  • Copy "fmodapi375win\api\lib\fmodvc.lib" to "libraries\i686-win32\lib_debug"
  • Copy "fmodapi375win\api\fmod.dll" to "indra\newview"

gl

Quicktime

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

First Steps

Enviroment Setup

  • Open the \indra\indra_complete\indra_complete.sln solution in Visual Studio 2005.
  • Set newview to be the startup project.
  • Right click on each project in the solution, with the exception of lscript_compile_fb, and follow these steps for each:
    • 1. (screen shot) Under Configuration Properties, C/C++, General, change Treat Warnings As Errors to "No"
    • 2. (screen shot) Under Configuration Properties, C/C++, PreProcessor, insert the line ";_CRT_SECURE_NO_DEPRECATE"
    • 3. (screen shot) Under Configuration Properties, C/C++, Language, change Treat wchar_t as Built-in Type to "No (/Zc:wchar_t-)"

Code Editing

  • In linden\indra\llcommon\llstringtable.h @ line 103
--103: typedef std::hash_multimap<U32, LLStringTableEntry *> string_hash_t;
++103: typedef stdext::hash_multimap<U32, LLStringTableEntry *> string_hash_t;
  • In linden\indra\llcommon\llerror.h @ line 38, and linden\indra\win_updater\updater.cpp @ line 40
++#if LL_WINDOWS
++# if (_MSC_VER >= 1400)
++#  pragma warning(disable : 4996)
++# endif
++#endif
  • In linden\indra\llcommon\u64.cpp @ line 36
--36: char *aptr = strpbrk(str,"0123456789");
++36: const char *aptr = strpbrk(str,"0123456789");
  • linden\indra\llprimitive\llprimitive.cpp @ line 1200
--1200: exception_faces |= (1 << i);
++1200: exception_faces |= ((U64)1 << i);
  • linden\indra\llui\llsliderctrl.cpp @ line 218 & line 251
--218: F32 displayed_value = (F32)(floor(getValueF32() * pow(10, mPrecision) + 0.5) / pow(10, mPrecision));
++218: F32 displayed_value = (F32)(floor(getValueF32() * pow(10.0, mPrecision) + 0.5) / pow(10.0', mPrecision));
  • linden\indra\newview\llstartup.cpp @ line 1459
--1459: gUTCOffset = (server_utc_time - now);
++1459: gUTCOffset = (server_utc_time - (S32)now);
  • linden\indra\newview\llpaneldirevents.cpp @ line 137, and line 169
--137: internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime);
++137: internal_time = utc_to_pacific_time((S32)utc_time, gPacificDaylightTime);
--169: internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime);
++169: internal_time = utc_to_pacific_time((S32)utc_time, gPacificDaylightTime);
  • linden\indra\newview\llfloaterreporter.cpp @ line 668
--668: msg->addU32Fast(_PREHASH_Time, mcd->mTime);
++668: msg->addU32Fast(_PREHASH_Time, (U32)mcd->mTime);
  • linden\indra\newview\llfloaterland.cpp @ line 2609, and line 2878
--2609: S32 now = time(NULL);
++2609: S32 now = (S32)time(NULL);
--2878: S32 now = time(NULL);
++2878: S32 now = (S32)time(NULL);
  • linden\indra\newview\llfloaterbump.cpp @ line 120
--120: timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime);
++120: timep = utc_to_pacific_time((S32)mcd->mTime, gPacificDaylightTime);
  • linden\indra\newview\viewer.cpp @ line 2510
srand((U32)time(NULL));
  • linden\indra\newview\llpaneldirevents.cpp @137,169
typecast to (S32)utc_time
  • linden\indra\newview\llurlwhitelist.cpp @42,43
change
 mUrlList ( 0 ),
 mUrlListIter ( 0 )
to
 mUrlList (  ),
 mUrlListIter (  )

Misc. Code Editing

  • linden\indra\test\llinventory.cpp @ line 1433


  • Build either ReleaseNoOpt (for debugging) or ReleaseForDownload (for production).
  • newview.exe will be built in \indra\newview\ReleaseNoOpt or \indra\newview\ReleaseForDownload
  • create a shortcut to newview, and change the start location to \indra\newview\ (all the .dll will be found there.)