-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot find include files #1230
Comments
Angle-bracket form: the preprocessor searches for include files in the under Because your ange-bracket include is a relative path Assuming that the folder of ACME is
You have to use forward slashes! |
Thanks @guwirth . This unblocked me and my scan can now find include files. Is it possible to use sonar.cxx.includeDirectories as a multiline property? I have dozens of include directories I will need to add and its very messy to keep it all on the same line. I tried splitting it into multilines similar to the way im using sonar.cxx.defines but I have had no luck. If its not possible I think that should be a feature request. Thanks |
sonar.cxx.includeDirectories is a comma separated list of directories where the plugin will be looking for included files. |
-Dsonar.cxx.includeDirectories=./main/inc, ../hrl/inc, ../prl/inc |
It turns out that the space after comma is not good. |
@guwirth we have tons of opened issues because of warnings. I believe we should address them as a whole:
W.r.t. to the issue itself: The benefit of the We have one more issue #1489, that also addresses the missing-include warnings. Since the preprocessor is not that needed and not really maintainable (#1500), we should start clean it up:
Should I create a US for one of above alternatives? |
In the past we had a lot of issues because of missing warnings. So maybe there are too much now.
Beforehand it's sometimes difficult to decide if an issue will afterwards be an info, warning or maybe error.
My proposal in other issue was an additional interface for checks: preprocessor needed.
And impact on metrics...
Same recommendation as in other issue #1528: Would start with this global configuration property. Maybe |
@guwirth @ivangalkin why just reduce the WARN to DEBUG, so they are disable by default? |
@jmecosta in the past users were complaining that they got no warning. This was the reason to move it from debug to warn. I like more the approach from @ivangalkin to display it as warning only when we need the preprocessor (e.g. in checks). But I think it's also an interesting approach to see if we need an preprocessor at all to get accurate results. |
I will make a proposal to generate only one warning at the end of the LOG file. Details will be provided only if debug info are on (same approach as #1565). Warning: |
When running the sonar-scanner command on a c++ project I get:
cannot find the sources for '#include <acme/bar/common/Logging.h>'
I see this for all of my include files throughout my project. For reference I do have the include file in question in my repo:
find . -name Logging.h
./bar/src/common/include/acme/bar/common/Logging.h
my sonar-project.properties file has the following defined:
I also tried the following combinations. With all of them I was not able to fine Logging.h:
Here is the entire sonar-project.properties file:
Im using SonarQube 5.5.6 with version 0.9.7 of the C++ Plugin. Im running sonar with the embedded Database (https://hub.docker.com/_/sonarqube/)
The text was updated successfully, but these errors were encountered: