The analysis of a C++ application using C Family extension fails from the beginning, with the following error in the analysis log file :
Some paths could not be substituted: `$(WINREGISTRY,"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++\ProductDir")\MFC\Include, $(WINREGISTRY,"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\6.0\Setup\Microsoft Visual C++\ProductDir")\Include'.
This error comes from a check done by the analyzer in the Windows registry before it starts working : if the Microsoft IDE required for analysis is not installed on the analysis machine, it will stop with this message. Refer to C and C++ Required third-party software to learn more about the required IDE
Release | Yes/No |
---|---|
C and Cpp Analyzer 2.2 | |
C and Cpp Analyzer 2.1 | |
C and Cpp Analyzer 2.0 |
RDBMS | Yes/No |
---|---|
Oracle Server | |
Microsoft SQL Server | |
CSS3 | |
CSS2 | |
CSS1 |
- Discover the source and deliver
- Run the analysis
- See the Analysis log file
The issue is caused because there exists an Analysis Unit for the windows registry entry of the Visual Studio, selected in the AU configuration, is not found.
To troubleshoot the issue:
Check if the Visual Studio version that has been set in the AU is installed in your analysis server
Open the analysis log and check the configuration of all analysis unit for the IDE(s) used by every single one analysis unit. For example:
IDEIDE used for this Analysis Unit : VC++ 2006
IDE used for this Analysis Unit : VC++ 2005 Console
Verify that each version of Visual Studio version that is referenced is installed on the analysis server. This is a prerequisite if you intend to use the CAST - VC++ XXX - Mandatory Part Environment Profile, which is the recommended setting when you analyze source code that has been developed in Visual Studio IDE.
If you opt to not install Visual Studio on the analysis server(this will impact the results), select the following analysis options in the CAST Management Studio for the AU:
IDE Options"IDE used for this Analysis Unit" is set to "Not Specified"
"STL Support" is set to "Cast emulation- If you opt to install Visual Studio verify that it corresponds to the one selected in the analysis unit configuration and rerun analysis. If the issue persists go to next step
Check if the windows registry entry quoted in the error message exists on the analysis server
Retrieve the windows registry path from the error message in the analysis log file. For example:
Some paths could not be substituted: `$(WINREGISTRY,"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir")\include, $(WINREGISTRY,"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VC\ProductDir")\atlmfc\include'.
The registry entry is related to the windows visual studio version that has been selected in the AU configuration according to Visual Studio Versions
- Open windows registry editor and verify that the referenced path exists on your local machine. For example:
- If the path is not present, verify if you are using windows 32 or 64 bits
- If you are using 64-bit windows, then
- Take a backup of the local database
- Run the following script on your local database, for example, named local_C:Update Reg Path on Local
SET SEARCH_PATH TO local_C UPDATE DEFANA_ENTITYATTR SET ATTR_VALUE_STRING = REPLACE(ATTR_VALUE_STRING,'SOFTWARE\Microsoft\','SOFTWARE\WOW6432Node\Microsoft\') WHERE ATTR_VALUE_STRING like '%VisualStudio%'
- If you are using 64-bit windows, then
- If the path is not present, verify if you are using windows 32 or 64 bits
- If the issue persists contact CAST Technical Support with the below relevant input.
Impact of issue: Analysis will stop
Impact after applying solution: Analysis will run successfully
Relevant Input
- CAST Support Tool (CST) - alias Sherlock. Option to select: Export Logs, Export CAST Database (Management+Local database only)
- Only C++ Project files are required.