we have a C++ project. This project is compiled on clang, gcc and VisualStudio. Because we want to use GCov, we have to compile the project with G++ (and the corresponding gcov options).
I use the “make” of Cygwin in conjunction with the buildwrapper:
build-wrapper-win-x86-64.exe --out-dir C:\git\BlueConnect_Framework\build_wrapper_output_directory C:\software\cygwin\bin\make -j clean all
Build and link is successful.
After invoking sonar-scanner, sonar comes with an error message:
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
* you are using the latest version of the build-wrapper and the SonarCFamily analyzer
* you are correctly invoking the scanner with correct configuration * your compiler is supported
* you are wrapping your build correctly
* you are wrapping a full/clean build
* you are providing the path to the correct build-wrapper output directory
* you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:357)
Yes,
we use the latest wrapper and plugin,
we wrap correctly,
we make a full clean build,
paths are correct …
Is that possible and correct, how we do that?
Do you have any ideas?
I suppose, the reason was that I was called the build-command (over the wrapper) and scan from different directories. As soon as I am further here, I will give feedback.
Currently I have a licensing problem, see also Licence "Developer-Edition" without CFamily (Sonar C++)
We are in general able to build our project with XCode (on Macs), Android, Cygwin and Visual Studio.
The decision for Cygwin came because of two reasons: Windows is most convenient in our IT-structure and Code-coverage with gcovr depends on gcc. For that, Cygwin (in my understanding) is the only licence-free match (or am I wrong?).
we support Visual Studio coverage format if you prefer to use Visual Studio or you could use Cygwin commands but from Windows prompt (note that in Cygwin you would still be affected by CPP-2438).
Dear @mpaladin
Visual Studiio is currently no option (because of licence-costs).
What do you mean with “you could use Cygwin commands but from Windows prompt”… ?
I now have a simple “HelloSonar” project (file, test file and googltest) that I can provide.
Best regards, Ralf
when you work from cygwin prompt all the paths are unix style which aren’t recognized on our side on Windows. Could you try with mingw and a gcc build for mingw? If I am not wrong on mingw and other gcc distributions for Windows the paths are kept Windows style.