Difference between revisions of "Converting project files for MSVS2005"

From Second Life Wiki
Jump to navigation Jump to search
m (fixed "Linden Lab")
 
(22 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{CompileNav}}
{{CompileNav}}
<br/>
 
= Manual conversion of the VS2003 solution/projects =
= 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.
This page describes the steps necessary to fully convert Linden Lab solution and project files from VS2003 to VS2005.  
 
There are canned sets of these available on the [https://jira.secondlife.com/browse/VWR-1151 JIRA bug tracker issue VWR-1151], so downloading these may save you the work described below.


There are canned sets of these available on the [https://jira.secondlife.com/browse/VWR-1151 JIRA bug tracker issue VWR-1151] for selected versions, so downloading these may save you the work described below, if the version you are about to build is on JIRA.  (As of this writing, there are solution/project files for 1.17, 1.18 and 1.19 series of viewer sources.)


== Global steps ==
== Global steps ==
Line 13: Line 12:
* 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.
* 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".
* Right click '''newview''' in the frame Solution Explorer and click "Set as StartUp Project".
* From your Visual Studio directory (Microsoft Visual Studio 8\VC\VCProjectDefaults) copy UpgradeFromVC71.vsprops to your SL build directories. For convenience I suggest you name it SL-UpgradeFromVC71.vsprops and put it into the indra_complete folder (where the indra_complete.sln file resides).
* From the Visual Studio menu bar, choose "File > New > File...".  On the "New File" dialog box, choose "General", then "Text File".  Select the lines from the box below in 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 '''linden/indra/indra_complete''' (where the "indra_complete.sln" file resides.)
** Edit SL-UpgradeFromVC71_vc8.vsprops with a text editor. For the 2 lines containing PreprocessorDefinitions add ''';_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;_SECURE_SCL=0'''
* Alternately download the file from [http://www.blueflash.cc/users/nicholaz/~libs/sl-UpgradeFromVC71_vc8.vsprops here] (right click link, Save As, go to the '''linden/indra/indra_complete''' folder)
** Under the first Preprocessor definitions (in the "VCCLCompilerTool" section) add a line with:  '''TreatWChar_tAsBuiltInType="false"'''
 
** Here is what the file will look like after the edit:
  <?xml version="1.0"?>
  <?xml version="1.0"?>
  <VisualStudioPropertySheet
  <VisualStudioPropertySheet
Line 25: Line 23:
         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"
     />
     />
Line 32: Line 31:
     />
     />
  </VisualStudioPropertySheet>
  </VisualStudioPropertySheet>
<br />
<br />


== All Configuration Steps ==
== All Configuration Steps ==
#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.)   
# 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.)   
# Right click on the selection and choose Properties.
# Right click on the selection and choose Properties.
# In the tree single click (select) '''Configuration Properties'''
# A window named Property Pages opens.  There single left-click (select) '''Configuration Properties''' in the tree on the left of the window.
# In the upper left corner choose '''All Configurations''' from the drop down box
# In the upper left corner of Property Pages choose '''All Configurations''' from the Configuration drop down box.
# Under the Configuration Properties > General change '''Inherited Project Property Sheets''' and enter the full pathname for your SL-UpgradeFromVC71_vc8.vsprops (if you put it in the indra_complete folder you can use '''$(SolutionDir)\SL-UpgradeFromVC71_vc8.vsprops''' instead of the full path)
# 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.)
# Under the Configuration Properties > C/C++ > General, change '''Treat Warnings As Errors''' to "'''No'''".  ([[:Image:MSVS2005_Project_Property_Pages_Config_CPP_General.JPG|'''screen shot''']])
# press enter or click anywhere outside the '''Inherited Project Property Sheets''' field to commit the changes to the field.
# Under the Configuration Properties > C/C++ > Language, change (if necessary) '''Treat wchar_t as Build-in Type''' to "'''No (/Zc:wchar_t-)'''" ([[:Image:MSVS2005 Project Property Pages Config CPP Language.JPG|'''screen shot''']]).
# Click Apply button of the dialog.  Make sure that the '''Inherited Project Property Sheets''' field keeps your entry (the Apply button will clear the field if the file is wrong or if it was not found).
# Click OK for the dialog
# Under the '''Configuration Properties > C/C++ > General''', make sure '''Treat Warnings As Errors''' is set to "'''No'''" (this should happen through the above inherited property sheet vsprops file, otherwise do it manually).  ([[:Image:MSVS2005_Project_Property_Pages_Config_CPP_General.JPG|'''screen shot''']]).
<br />
# Under the '''Configuration Properties > C/C++ > Language''', make sure '''Treat wchar_t as Build-in Type''' is to "'''No (/Zc:wchar_t-)'''" (this should happen through the above inherited property sheet (vsprops) file, otherwise do it manually) ([[:Image:MSVS2005 Project Property Pages Config CPP Language.JPG|'''screen shot''']]).
<br />
# Under the '''Configuration Properties > C/C++ > Advanced''', change (if necessary) '''Use Full Paths''' to "'''Yes (/FC)'''" ([[:Image:MSVS2005 Project Property Pages Config CPP Advanced.JPG|'''screen shot''']]).
# Click OK for the dialog.
 
== Per Configuration Steps ==
== Per Configuration Steps ==
* 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 (on left side of the VS2005 window):
* 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):
*#Click '''newview''' to select it alone.   
*# Left-click '''newview''' to select it alone.   
*#* Right-click '''newview''', choose Properties.
*# Right-click '''newview''', 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.
*# 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 '''libboost_regex-vc71-mt-s.lib'''.  Rewrite it to libboost_regex-vc'''80'''-mt-s.lib.
*# Scroll down the list to find '''libboost_regex-vc71-mt-s.lib'''.  Rewrite it to libboost_regex-vc'''80'''-mt-s.lib.
*#*Scroll down again to find '''llmozlib.lib''' and rewrite it to llmozlib'''-vc80'''.lib.
*#* For 1.20.2 and later, you can't find the above file name.  Instead, you need to find the following three files and replace them as follows:
*#*Click '''OK''' to close the "Additional Dependencies" dialog, then click OK again to close the "newview Property Pages" dialog box.
*#** Find '''libboost_regex-vc71-mt-s-1_34_1.lib''' and rewrite it to libboost_regex-vc'''80'''-mt-s-1_34_1.lib.
* Pick '''ReleaseForDownload''' in the Solution Configurations drop-down box.  Do the same thing (as 1 to 7 above) again.  Depending on what you want to do later (or if you want to do a full and complete conversion, you will also need to do it for Debug and Release).
*#** Find '''libboost_signals-vc71-mt-s-1_34_1.lib''' and rewrite it to libboost_signals-vc'''80'''-mt-s-1_34_1.lib.
<br />
*#** Find '''libboost_program_options-vc71-mt-s-1_34_1.lib''' and rewrite it to libboost_program_options-vc'''80'''-mt-s-1_34_1.lib.
*#* If you are working on later versions than 1.20.12 and you don't see exact file names specified above, try finding all file names of pattern libboost_*-vc71-*.lib, and rewrite the '''-vc71-''' part as '''-vc80-'''.  When you do it, please make sure the new file names (with '''-vc80-''') are found  in '''linden/libraries/i686-win32/lib_release''' directory. 
*# Scroll down again to find '''llmozlib.lib''' and rewrite it to llmozlib'''-vc80'''.lib.
*#* For viewer versions 1.19.1.X, this step is not needed.
*#* For viewer versions 1.20.0 or later, you don't see '''llmozlib.lib''' but see llmozlib'''2'''.lib here.  Rewrite it to llmozlib2-'''vc80'''.lib.
*# 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.X, 1.20.X, 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 llmozlib2'''d'''.lib.  So, you should change it to llmozlib2'''d-vc80'''.lib.  Click OK to close the dialog box.


== Optional steps ==
== 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
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:  
* In the Configuration manager (Build menu):  
** unclick '''test''', '''win_crash_logger''' and '''win_updater''' for all configurations except '''ReleaseForDownload'''.
** unclick the build column for '''test''', '''win_crash_logger''' and '''win_updater''' in all configurations '''except ReleaseForDownload'''.
** unclick '''test''' for '''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 dependancy)
* 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;'''
* 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, 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.
* 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 :-) ==
== Done :-) ==
Congratulations!  You've converted ''solution file'' and ''project files''.
Congratulations!  You've converted ''solution file'' and ''project files''.
It is recommended that you use '''File''' > '''Save All''' now, so that your changes are not lost in case your Visual Studio crushed...


'''NOTE:''' You need to do this by hand everytime a new viewer version is released...
'''NOTE:''' You need to do this by hand everytime a new viewer version is released...
<br />
 
<br />
[[Category:Compiling viewer]]
<br />

Latest revision as of 00:46, 2 September 2008

Manual conversion of the VS2003 solution/projects

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

There are canned sets of these available on the JIRA bug tracker issue VWR-1151 for selected versions, so downloading these may save you the work described below, if the version you are about to build is on JIRA. (As of this writing, there are solution/project files for 1.17, 1.18 and 1.19 series of viewer sources.)

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 lines from the box below in 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 linden/indra/indra_complete (where the "indra_complete.sln" file resides.)
  • Alternately download the file from here (right click link, Save As, go to the linden/indra/indra_complete folder)
<?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 (the Apply button will clear the field if the file is wrong or if it was not found).
  8. Under the Configuration Properties > C/C++ > General, make sure Treat Warnings As Errors is set to "No" (this should happen through the above inherited property sheet vsprops file, otherwise do it manually). (screen shot).
  9. Under the Configuration Properties > C/C++ > Language, make sure Treat wchar_t as Build-in Type is to "No (/Zc:wchar_t-)" (this should happen through the above inherited property sheet (vsprops) file, otherwise do it manually) (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.
      • For 1.20.2 and later, you can't find the above file name. Instead, you need to find the following three files and replace them as follows:
        • Find libboost_regex-vc71-mt-s-1_34_1.lib and rewrite it to libboost_regex-vc80-mt-s-1_34_1.lib.
        • Find libboost_signals-vc71-mt-s-1_34_1.lib and rewrite it to libboost_signals-vc80-mt-s-1_34_1.lib.
        • Find libboost_program_options-vc71-mt-s-1_34_1.lib and rewrite it to libboost_program_options-vc80-mt-s-1_34_1.lib.
      • If you are working on later versions than 1.20.12 and you don't see exact file names specified above, try finding all file names of pattern libboost_*-vc71-*.lib, and rewrite the -vc71- part as -vc80-. When you do it, please make sure the new file names (with -vc80-) are found in linden/libraries/i686-win32/lib_release directory.
    5. Scroll down again to find llmozlib.lib and rewrite it to llmozlib-vc80.lib.
      • For viewer versions 1.19.1.X, this step is not needed.
      • For viewer versions 1.20.0 or later, you don't see llmozlib.lib but see llmozlib2.lib here. Rewrite it to llmozlib2-vc80.lib.
    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.X, 1.20.X, 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.

It is recommended that you use File > Save All now, so that your changes are not lost in case your Visual Studio crushed...

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