Difference between revisions of "User:Robin Cornelius/viewer-development VC2005 Express"

From Second Life Wiki
Jump to navigation Jump to search
Line 6: Line 6:
==Compile against the correct VC80 4053 CRT==
==Compile against the correct VC80 4053 CRT==
The previous Service Pack does not appear to correctly update the default CRT that programs built with 2005 Express link against, to correct this behaviour edit C:\Program Files\Microsoft Visual Studio 8\VC\include\crtassem.h and change
The previous Service Pack does not appear to correctly update the default CRT that programs built with 2005 Express link against, to correct this behaviour edit C:\Program Files\Microsoft Visual Studio 8\VC\include\crtassem.h and change
Note: this file can be in your VC++2005/(8) Express Edition folder. Example on my system it is at:
C:\VC80\VC\include\crtassem.h but the edit below would be applied there. [[User:Nicky Perian|Nicky Perian]]
  #ifndef _CRT_ASSEMBLY_VERSION
  #ifndef _CRT_ASSEMBLY_VERSION
  #if defined _USE_RTM_VERSION
  #if defined _USE_RTM_VERSION

Revision as of 12:53, 25 August 2010

Visual C++ 2005 Express lacks a few features that LL rely on to sucessfully compile and package the viewer, but they are fairly easy to work around. Currently requires all fixes commited to http://bitbucket.org/robincornelius/viewer-development-vwr-20879

Update express to Service Pack 1 ATL Security Update

It is important that you have the 4053 version of the VC80 CRT installed, for Express editions this means installing http://www.microsoft.com/downloads/details.aspx?FamilyID=7c8729dc-06a2-4538-a90d-ff9464dc0197&displaylang=en . Simply installing the redistributables is not enough the static import libs etc all need upgrading which is why you should use the above link to update Visual Studio.

Compile against the correct VC80 4053 CRT

The previous Service Pack does not appear to correctly update the default CRT that programs built with 2005 Express link against, to correct this behaviour edit C:\Program Files\Microsoft Visual Studio 8\VC\include\crtassem.h and change Note: this file can be in your VC++2005/(8) Express Edition folder. Example on my system it is at: C:\VC80\VC\include\crtassem.h but the edit below would be applied there. Nicky Perian

#ifndef _CRT_ASSEMBLY_VERSION
#if defined _USE_RTM_VERSION
#define _CRT_ASSEMBLY_VERSION "8.0.50608.0"
#else
#define _CRT_ASSEMBLY_VERSION "8.0.50727.762"
#endif
#endif

to

#ifndef _CRT_ASSEMBLY_VERSION
#if defined _USE_RTM_VERSION
#define _CRT_ASSEMBLY_VERSION "8.0.50608.0"
#else
#define _CRT_ASSEMBLY_VERSION "8.0.50727.4053"
#endif
#endif

winres.h (2005/2008)

This file is not present with Visual Studio 2005/2008 express due to it mainly being an MFC header (MFC is not included with express), the actual requirments of this file are very low, it basicly needs to include windows.h and define IDC_STATIC. Edit.. It is found on some SDK installs as part of the examples, but regardless just creating it as follows solves issues.

Recommended work around is to create your own winres.h, in the Visual Studio system include location, so you always have it for all builds.

on a 32bit system - C:\Program Files\Microsoft Visual Studio 8\VC\include\winres.h on a 64bit system - C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\winres.h

#ifndef _WINRES_H
#define _WINRES_H

#include "windows.h"
#ifndef IDC_STATIC
#define IDC_STATIC 1000
#endif

#endif

Stage the CRT dlls

Due to differences in the registry entrys between express and full editions, it is not possible to get the location of the CRT dlls directly from the registry entries for Visual C++ express (also with express no licence is given to reistribute the runtimes). The correct redistrbutal package can be obtained from http://www.microsoft.com/downloads/details.aspx?familyid=766a6af7-ec73-40ff-b072-9112bab119c2&displaylang=en , after obtaining this setup.exe, open it using 7 Zip, WinRaR or some other program capable of opening this kind of compressed self extracting archive and extracts its contents to a convienent folder. You do need to rename 1 file in that folder :-

x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989.manifest

needs to be renamed to :-

Microsoft.VC80.CRT.manifest

now when invoking cmake pass the flag "-DMSVC_REDIST_PATH:PATH=c:\code\vcredist_vc80_4053_x86" where in this case my redistributables are in c:\code\vcredist_vc80_4053_x86 so adjust to suite where you unpacked the files.