Difference between revisions of "Microsoft Visual Studio"

From Second Life Wiki
Jump to navigation Jump to search
(Reviving the lost contents on Visual Studio setup.)
 
(21 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Warning|As of April 2011, all Viewer 2 builds MUST be performed with Visual Studio 2010. Please see [[Viewer 2 Microsoft Windows Builds]] for instructions.}}
{{CompileNav}}
{{CompileNav}}
= Setting up the Microsoft Visual Studio =
= Setting up the Microsoft Visual Studio =


Line 6: Line 9:
Recognized MSVS versions include:
Recognized MSVS versions include:


* Visual Studio .NET 2003 Professional
* Visual Studio 2005 Professional (recommended)
* Visual Studio 2005 Professional
* Visual C++ 2005 Express
* Visual C++ 2005 Express
* (Visual Studio/C++ 2008 is not covered yet.)
* Visual Studio/C++ 2008
* '''Deprecated''': Visual Studio .NET 2003 Professional (only for viewers 1.20 and earlier)


== Download Express (optional) ==
== Download Express (optional) ==
Line 15: Line 18:
If you do not already own one of the above recognized version, then you may download Microsoft's free IDE and compiler editions.
If you do not already own one of the above recognized version, then you may download Microsoft's free IDE and compiler editions.


[http://msdn.microsoft.com/vstudio/express/visualc/download/ Click here to download Visual C++ 2005 Express]
[http://download.microsoft.com/download/8/3/a/83aad8f9-38ba-4503-b3cd-ba28c360c27b/ENU/vcsetup.exe Click here to download Visual C++ 2005 Express with SP2]
 
If you installed Visual C++ Express 2005 SP1 (i.e. not using the link above) and want to build Snowglobe v1, make sure to install the [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7c8729dc-06a2-4538-a90d-ff9464dc0197 KB971090 security update] (else you will end up with a non-functional SLPlugin.exe and viewer because of embedded manifests containing two references to VC80.CRT, one for v8.0.50727.762 and the other for v8.0.50727.4053... unlike with v1.23 and previous viewers, some pre-compiled libraries were obviously compiled with the updated VC80 installed on the build system and your own build systems must have the matching VC80 libraries).
 
Make sure to apply the [http://www.microsoft.com/downloads/details.aspx?FamilyID=7b0b0339-613a-46e6-ab4d-080d4d4a8c4e  Service Pack 1] if you are using an older version of Visual C++ 2005 Express.  If you are using Windows Vista for development, you will need [http://www.microsoft.com/downloads/details.aspx?FamilyID=90e2942d-3ad1-4873-a2ee-4acc0aace5b6  Visual Studio 2005 Service Pack 1 Update for Windows Vista], too. Note: if you use the web installer that download data during install, then service packs are already included, no manuall install required (current SP is 2).
 
Note that, although the latest version of Visual C++ Express Edition is 2008, it is recommended to use 2005 version for the purpose of Second Life development for the moment.  This page will be updated when we get enough experiences on VC++ 2008. Note: before using 2008 it might be better to wait (as of december 2009), because the beta of VC 2010 is out and release should be available soon.


== Install Microsoft Platform & DirectX SDKs ==
== Install Microsoft Platform & DirectX SDKs ==


Download and install:
Download and install:
* [http://www.microsoft.com/downloads/details.aspx?familyid=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en Microsoft Platform SDK]
* [http://download.microsoft.com/download/5/1/f/51ff8357-0af3-418b-9d0b-e9a5cdc39759/dxsdk_dec2006.EXE DirectX 9.0 SDK (December 2006)]


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. Upon installing DirectX, it is sufficient to install the '''include''' and '''libraries''' part.  Other DX development tools are not necessary.
* '''The Windows Platform SDK'''
** Get the latest version (as of 29 Oct 2008) here: [http://www.microsoft.com/downloads/details.aspx?FamilyID=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en Windows SDK for Windows Server 2008 and .NET Framework 3.5]
* '''DirectX 9.0 SDK'''
** Get the latest version (as of 29 Oct 2008) here: [http://www.microsoft.com/downloads/details.aspx?FamilyID=ea4894b5-e98d-44f6-842d-e32147237638&DisplayLang=en DirectX 9.0 SDK (August 2008)]
 
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. Upon installing DirectX, it is sufficient to install only the '''Headers and Libs''' part.  Other DX development tools are not necessary.


'''NOTE:''' Default installation of both Platform SDK and DirectX SDK can be found in
NOTE: Make sure you install to paths without spaces in it.
* '''C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2''' and
* '''C:\Program Files\Microsoft DirectX SDK (December 2006)''', respectively.


== Setup the project globals ==
== Setup the project globals ==
* Start Visual Studio
* Start Visual Studio
* Go to Tools > Options > Projects > VC++ Directories
* Go to Tools > Options > Projects and Solutions > VC++ Directories
* Make sure that the '''includes''' and '''libraries''' paths ("Include files" and "Library files" in the "show directories for" dropdown) exist, and add them if they don't, in the following order: (see screenshots below)
* Make sure that the '''includes''' and '''libraries''' paths ("Include files" and "Library files" in the "show directories for" dropdown) exist, and add them if they don't, in the following order: (see screenshots below)
*# Platform SDK paths
*# Platform SDK paths
Line 41: Line 51:
== Compiling the Second Life viewer ==
== Compiling the Second Life viewer ==


Refer to these topics on how to compile the viewer with Microsoft Visual Studio:
Refer to this page for instructions on how to build the viewer: [[Microsoft Windows Builds]]
 
[[Category:Compiling viewer]]
 
== Extra steps for Visual Studio Express editions ==
 
After running develop.py, some extra steps are required if you use an express edition of Visual Studio.
 
=== Set Build type ===
After opening the solution, the first thing todo is set the build type, as shown in the following picture -
 
[[File:SelectBuildType.jpg]]
 


* [[Compiling the viewer (MSVS2003)|Microsoft Windows - Visual Studio .NET 2003]] (recommended, Linden Lab uses VS2003)
=== Set Startup project ===
** see also: [[Compiling the viewer libraries (MSVS 2003)]]
* [[Compiling the viewer (MSVS2005)|Microsoft Windows - Visual Studio 2005 & Visual C++ 2005 Express]]


Following alternative methods are also available for experienced developers:
You now need to set the start up project, right click in the solution explorer on secondlife-bin and from the popup menu select "Set As StartUp Project" , as shown -


* [[User:Dzonatas Sol/Compiling The Viewer|Building with SCons]] (can build without project files, based on python)
[[File:SelectSecondLifeBinAsStartUp.jpg]]
* [[CMake|Building with CMake]] (generates project files to build -- experimental)


== Screenshots ==
=== Set Working Directory ===


* Example screenshot of Tools > Options > Projects > VC++ Directories > Includes files
Finally, again right click on secondlife-bin in the solution explorer, and this time select properties. On the window that opens select "Configuration Properties" on the left and then "Debugging" to get the view shown below, in the box Working Directory, add the text "..\..\newview" then press "OK"
[[Image:MSVS2005 Global Project Options Include Files.JPG|center]]
<br/>


* Example screenshot of Tools > Options > Projects > VC++ Directories > Libraries files
[[File:SetWorkingDirectory.jpg]]
[[Image:MSVS2005 Global Project Options Library Files.JPG|center]]

Latest revision as of 09:04, 20 April 2011

Warning!

As of April 2011, all Viewer 2 builds MUST be performed with Visual Studio 2010. Please see Viewer 2 Microsoft Windows Builds for instructions.


Setting up the Microsoft Visual Studio

This page describes installation and configuration properties for Microsoft Visual Studio (MSVS) as it relates to a development environment for Second Life.

Recognized MSVS versions include:

  • Visual Studio 2005 Professional (recommended)
  • Visual C++ 2005 Express
  • Visual Studio/C++ 2008
  • Deprecated: Visual Studio .NET 2003 Professional (only for viewers 1.20 and earlier)

Download Express (optional)

If you do not already own one of the above recognized version, then you may download Microsoft's free IDE and compiler editions.

Click here to download Visual C++ 2005 Express with SP2

If you installed Visual C++ Express 2005 SP1 (i.e. not using the link above) and want to build Snowglobe v1, make sure to install the KB971090 security update (else you will end up with a non-functional SLPlugin.exe and viewer because of embedded manifests containing two references to VC80.CRT, one for v8.0.50727.762 and the other for v8.0.50727.4053... unlike with v1.23 and previous viewers, some pre-compiled libraries were obviously compiled with the updated VC80 installed on the build system and your own build systems must have the matching VC80 libraries).

Make sure to apply the Service Pack 1 if you are using an older version of Visual C++ 2005 Express. If you are using Windows Vista for development, you will need Visual Studio 2005 Service Pack 1 Update for Windows Vista, too. Note: if you use the web installer that download data during install, then service packs are already included, no manuall install required (current SP is 2).

Note that, although the latest version of Visual C++ Express Edition is 2008, it is recommended to use 2005 version for the purpose of Second Life development for the moment. This page will be updated when we get enough experiences on VC++ 2008. Note: before using 2008 it might be better to wait (as of december 2009), because the beta of VC 2010 is out and release should be available soon.

Install Microsoft Platform & DirectX SDKs

Download and install:

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. Upon installing DirectX, it is sufficient to install only the Headers and Libs part. Other DX development tools are not necessary.

NOTE: Make sure you install to paths without spaces in it.

Setup the project globals

  • Start Visual Studio
  • Go to Tools > Options > Projects and Solutions > VC++ Directories
  • Make sure that the includes and libraries paths ("Include files" and "Library files" in the "show directories for" dropdown) exist, and add them if they don't, in the following order: (see screenshots below)
    1. Platform SDK paths
    2. DirectX SDK paths
    3. Visual C++ paths
    • NOTE: The newest DirectX SDK ("December 2006") lib folder has two sub-folders, x64 and x86. Make sure your path goes to one of them (select lib/x86, not just lib), or you will get a Link error. For the Windows Platform SDK, there is not a subfolder for x86 (even though there are subfolders for AMD64, IA64, etc.), so do not select a subfolder for the Windows Platform SDK.
  • Also, make sure that your cygwin (default C:\cygwin\bin) and ActivePython (default C:\Python25) directories are under the "Executable files" dirs and moved to the bottom of the list. (Even if you update your PATH environment variable, those changes will NOT be reflected inside Visual Studio!)

Compiling the Second Life viewer

Refer to this page for instructions on how to build the viewer: Microsoft Windows Builds

Extra steps for Visual Studio Express editions

After running develop.py, some extra steps are required if you use an express edition of Visual Studio.

Set Build type

After opening the solution, the first thing todo is set the build type, as shown in the following picture -

SelectBuildType.jpg


Set Startup project

You now need to set the start up project, right click in the solution explorer on secondlife-bin and from the popup menu select "Set As StartUp Project" , as shown -

SelectSecondLifeBinAsStartUp.jpg

Set Working Directory

Finally, again right click on secondlife-bin in the solution explorer, and this time select properties. On the window that opens select "Configuration Properties" on the left and then "Debugging" to get the view shown below, in the box Working Directory, add the text "..\..\newview" then press "OK"

SetWorkingDirectory.jpg