CMS Snapshot Analysis - Run Analyzer - Fatal Error - CPP with Core CAST AIP - Some paths could not be substituted
The analysis of a C++ application 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
Please refer to Official Documentation to learn more about the required IDE
|Microsoft SQL Server
- Discover the source and deliver
- Run the analysis
- See the Analysis log file
- Compare the IDE quoted in the error message with the IDE entered in Cast-MS. If they are identical, proceed to step 2. If not, proceed to step 3.
Open the analysis log file :
SESSION CONTEXT details:
345701 ; 469211 = "Activite"."Annuaire322008_30927_Cpp"
About to run JOB_C_ANALYZER job 'Annuaire322008_30927_Cpp'.
Total physical memory: 4095 MB.
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'.
New Job status
Execution date=2017/08/01 14:23
Execution duration=0 days, 00 hours, 00 mins, 01 secs
0 fatal error(s); 1 error(s); 0 warning(s); 110 information message(s).
In this example log file, the IDE in the error message is Visual Studio 9.0
Now, in the analysis log go to the top where the configuration of the analysis unit gets loaded and check for the IDE used for analysis units:
Analyzer to invoke : Clang-based analyzer
Consider Files as : C++ only
IDE used for this Analysis Unit : VC++ 2006 Console
STL Support : STL already in your Source Code Repository
In this example, the IDE in Cast-MS is VC++ 2006 Console which is not the same as in the error message.
- If the IDE are the same, then it is normal that the analyzer looks for the entries in Windows Registry. Proceed to step 2, check Cast-MS Configuration
- If the IDE are not the same, then proceed to step 3, check if you do not have several versions of project files in your source code.
- Check Cast-MS configuration
- First check if the IDE entered in Cast-MS is compatible with your vcproj files.
- Open your vcproj files like below and look for the version of Visual Studio which was used :
- Change the IDE in Cast-MS to an IDE that supports your vcproj files (same vesion as the files or newer). This is to make sure that the IDE selected in Cast-MS is compatible (newer) with the version of your vcproj files.
- Check if the IDE in Cast-MS is properly installed. If you did not change the IDE in Cast-MS, then the error message means it is not properly installed. Re-install it.
If you changed the IDE in Cast-MS then see if the new IDE you set is installed on the analysis server. If not, install it.
If the issue persists contact CAST Technical Support with the below relevant input.
- Check if you do not have several versions of project files in your source code.
If the IDE quoted in the error message and the IDE set in Cast-MS are not the same, it can be due to several project file versions in the source code. For example, if you set Visual Studio 8 in Cast-MS but the analyzer is looking for Windows Registry entries related to Visual Studio 6, check if you do not have some old Visual Studio 6 vcproj files delivered with the source.
If so, remove them from the source and relaunch analysis.
If issue persists then contact CAST Technical Support with below relevant input.
Impact of issue: Analysis will stop
Impact after applying solution: Analysis will run successfully