Include files are found when I tried to specify each directory as additional includes “/I” by manually editing the json file. "\/IC:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30037\\ATLMFC\\include","\/IC:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30037\\include","\/IC:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um","\/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt","\/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared","\/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um","\/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt","\/IC:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt","\/IC:\\FND32\\include","\/IC:\\FND32\\SINCLUDE",
If I understand correctly your problem: the build command with the build-wrapper succeeds, as well as the sonar-scanner command (you can see that your code was analyzed in your SonarQube instance).
But because stdlib.h was not found, the results of the analysis may be inaccurate for some files.
Am I correct?
I can see in the logs that a reproducer was generated. Could you send me the following please:
the full path to the file
stdlib.h
the file
C:\Sonar\Generated\CLang\sonar-cfamily-reproducer.zip
Yes you are correct, all succeeds and the result is displayed in Sonarqube Dashboard.
But when i tried to workaround the missing *.h files like what i mentioned on my original request, there were 5 bugs detected which were not reported originally. So, it seems that i really need to fix it to get more accurate results.
The full path of stdlib.h is C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\ucrt\stdlib.h
What you say totally makes sense: when we can’t find stdlib we don’t have enough information to find the 5 bugs you mention. So indeed it would be better if we can fix the problem, to have a more precise analysis.
Would you be able to update your SonarQube to the 8.9 version (latest LTS) or to the latest version 9.0, please? The one you’re currently using (8.7) is not supported anymore.
At current time, upgrading to version 8.9 (latest LTS) is not possible. I reached out to our support team and this is not yet their current priority.
I am hoping that there’s something else we can do to workaround my issue.
The issue seems to come from the fact that while overriding the environment variable INCLUDE so that it contains specific things you need, you modify the way it is written. So it is written in lower cases in your case (include) when it is usually in upper cases (INCLUDE).
We created a ticket to handle this: CPP-3206.
In the meanwhile, keeping INCLUDE in upper cases should fix the problem.
Wow Thank You @Amelie!
I changed my environment variable (include) to upper case (INCLUDE) and it works. There were no more missing libraries. I’m glad you created a ticket for this.