CMS Snapshot Analysis - Run Analyzer - Fatal Error - CPP with Extension - Some paths could not be substituted
Description
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
Observed in CAST Extension
| Release | Yes/No |
|---|---|
| C and Cpp Analyzer 2.2 | ✅ |
| C and Cpp Analyzer 2.1 | ✅ |
| C and Cpp Analyzer 2.0 | ✅ |
Observed on RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ✅ |
| Microsoft SQL Server | ✅ |
| CSS3 | ✅ |
| CSS2 | ✅ |
| CSS1 | ✅ |
Step by Step Scenario
- Discover the source and deliver
- Run the analysis
- See the Analysis log file
Action Plan
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:
IDE
IDE 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 emulationIf 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](https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History)
2. Open [windows registry editor](https://support.microsoft.com/en-au/help/4027573/windows-10-open-registry-editor) and verify that the referenced path exists on your local machine. For example:
3. 
1. If the path is not present, [verify if you are using windows 32 or 64 bits](https://www.howtogeek.com/howto/21726/how-do-i-know-if-im-running-32-bit-or-64-bit-windows-answers/)
1. If you are using 64-bit windows, then
1. Take a backup of the local database
2. Run the following script on your local database, for example, named local\_C:
```java
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 the issue persists contact CAST Technical Support with the below relevant input.
Impact on Analysis Results and Dashboard
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.
Notes/comments
Related Pages