Difference between revisions of "Converting project files for MSVS2005"

From Second Life Wiki
Jump to navigation Jump to search
Line 22: Line 22:
         Name="VCCLCompilerTool"
         Name="VCCLCompilerTool"
         PreprocessorDefinitions="_VC80_UPGRADE=0x0710;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;_SECURE_SCL=0"
         PreprocessorDefinitions="_VC80_UPGRADE=0x0710;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;_SECURE_SCL=0"
        WarnAsError="false"
         TreatWChar_tAsBuiltInType="false"
         TreatWChar_tAsBuiltInType="false"
     />
     />

Revision as of 07:44, 5 May 2008

Manual conversion of the VS2003 solution/projects

This page describes the steps necessary to fully convert Linden Labs solution and project files from VS2003 to VS2005.

There are canned sets of these available on the JIRA bug tracker issue VWR-1151, so downloading these may save you the work described below.

Global steps

  • Start Visual Studio 2005 (or VC++ Express).
  • Use "File > Open > Project/Solution" to open the linden\indra\indra_complete\indra_complete.sln
  • Visual Studio prompts to update your project files. Allow it to do so. When the results are displayed, you may see warnings, but you should not see any errors.
  • Right click newview in the frame Solution Explorer and click "Set as StartUp Project".
  • From the Visual Studio menu bar, choose "File > New > File...". On the "New File" dialog box, choose "General", then "Text File". Select the following lines on your browser, copy them, and paste them to the empty file you just created. Save it as a file of the name "SL-UpgradeFromVC71_vc8.vsprops" under the folder "indra_complete" (where the "indra_complete.sln" file resides.)
<?xml version="1.0"?>
<VisualStudioPropertySheet
   ProjectType="Visual C++"
   Version="8.00"
   Name="Upgrade From VC 7.1">
   <Tool
       Name="VCCLCompilerTool"
       PreprocessorDefinitions="_VC80_UPGRADE=0x0710;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;_SECURE_SCL=0"
       WarnAsError="false"
       TreatWChar_tAsBuiltInType="false"
   />
   <Tool
       Name="VCResourceCompilerTool"
       PreprocessorDefinitions="_VC80_UPGRADE=0x0710;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;_SECURE_SCL=0"
   />
</VisualStudioPropertySheet>

All Configuration Steps

  1. Select all projects, i.e., llaudio, llcharacter, ..., win_updater, except for lscript_compile_fb and test. (You can do it by control-clicking on the projects.)
  2. Right click on the selection and choose Properties.
  3. A window named Property Pages opens. There single left-click (select) Configuration Properties in the tree on the left of the window.
  4. In the upper left corner of Property Pages choose All Configurations from the Configuration drop down box.
  5. Now, in the tree select Configuration Properties > General and change Inherited Project Property Sheets and set it to $(SolutionDir)\SL-UpgradeFromVC71_vc8.vsprops. (Write this literally, as opposed to replacing "$(SolutionDir)" with some real path.)
  6. press enter or click anywhere outside the Inherited Project Property Sheets field to commit the changes to the field.
  7. Click Apply button of the dialog. Make sure that the Inherited Project Property Sheets field keeps your entry (if the file is wrong or not found, the Apply button will clear the field again).
  8. Under the Configuration Properties > C/C++ > General, change Treat Warnings As Errors to "No". (screen shot).
  9. Under the Configuration Properties > C/C++ > Language, change (if necessary) Treat wchar_t as Build-in Type to "No (/Zc:wchar_t-)" (screen shot).
  10. Under the Configuration Properties > C/C++ > Advanced, change (if necessary) Use Full Paths to "Yes (/FC)" (screen shot).
  11. Click OK for the dialog.

Per Configuration Steps

  • Pick ReleaseNoOpt in the Solution Configurations drop-down box next to the green arrow under the tool bar, and do the followings on the Solution Explorer frame (on left side of the VS2005 window):
    1. Left-click newview to select it alone.
    2. Right-click newview, choose Properties.
    3. 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.
    4. Scroll down the list to find libboost_regex-vc71-mt-s.lib. Rewrite it to libboost_regex-vc80-mt-s.lib.
    5. Scroll down again to find llmozlib.lib and rewrite it to llmozlib-vc80.lib. (This step is not needed on viewer version 1.19.1.0 or later.)
    6. 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 (in the toolbar, next to the green arrow). Repeat the same steps (as for ReleaseNoOpt above) again.
  • Depending on what you want to do later (or if you want to do a full and complete conversion), you may also need to perform these steps for the Debug and Release configurations, but for a start it is safe to skip these.

Special configuration steps for llmedia (1.19.1 or later only)

  • Right click on the llmedia project on the solution explorer, then choose Properties.
  • Choose Release in the Configuration drop down box on the upper loft of the "llmedia Property pages."
  • Choose Configuration Properties > Librarian > General on the tree on the left.
  • In Additional Dependencies, there is llmozlib2.lib. Change it to llmozlib2-vc80.lib.
  • Click OK to close the dialog box.
  • Right click on the llmedia project, and choose Properties again.
  • Choose ReleaseNoOpt in the Configuration. Do the same thing as for Release again. Click OK to close the dialog box.
  • Right click on the llmedia project, and choose Properties, for the third time.
  • Choose Debug in the Configuration. Do the similar thing, too. However, Additional Dependencies for Debug includes llmozlib2d.lib. So, you should change it to llmozlib2d-vc80.lib. Click OK to close the dialog box.

Optional steps

The following steps are not strictly necessary, unless you want a full and ultra clean conversion (e.g. for sharing with others). These instructions are telegram style, assuming you will do this only after you have aquainted yourselves with the project

  • In the Configuration manager (Build menu):
    • unclick the build column for test, win_crash_logger and win_updater in all configurations except ReleaseForDownload.
    • unclick the build column for test in ReleaseForDownload
  • For all configurations: In newview, properties, linker input: If you find libraries starting with 'll' (e.g. llaudio.lib, llcharacter.lib, etc.) or find the library lscript_library.lib), remove them from the list (these libraries are linked through the dependency)
  • For all configurations: In newview, properties, linker input: Set Ignore Specific Library to msvcrt.lib;msvcrtd.lib;libc.lib;libcd.lib;
  • In the Debug configuration, under lscript_compile_fb, indra.y, properties, custom build step, general, command line, make sure you have C:\cygwin\bin\mv.exe ytab.hpp ytab.h (use the command line from the release configuration as reference).
  • In the Debug configuration, also add libcmt.lib; to the list of specific libraries to ignore.
  • In all configurations: the libraries need to be changed from vc71 to vc80 (boost, llmozlib) for the test project as well, but since test does not seem to work under VC2005 so far, it's optional.

Done :-)

Congratulations! You've converted solution file and project files.

NOTE: You need to do this by hand everytime a new viewer version is released...