Yes this is possible. This is a common mix of languages in the .Net world.
See this section of the C/C++ documentation. That should help you. If you still have questions, get back to this thread.
SonarScanner.MSBuild.exe begin /k:"cs-and-cpp-project-key" /n:"My C# and C++ project" /v:"1.0" /d:sonar.cfamily.build-wrapper-output="build_wrapper_output_directory"
build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory MSBuild.exe /t:Rebuild
SonarScanner.MSBuild.exe end
The given link mentions that you must run MSBuild “wrapped” with build wrapper.
# Run scanner begin step and
# pass a build wrapper output directory of your choice (local temp directory)
SonarScanner.MSBuild.exe begin /k:xxxxx /d:sonar.host.url=xxx.xx/d:sonar.verbose=true /d:sonar.login=xxxx /d:sonar.cfamily.build-wrapper-output=“build_wrapper_output_directory”
# Run MSBuild with build-wrapper wrapping around it
# and pass same output directory to build wrapper
build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory MSBuild.exe “MPBuild.sln” /t:Clean /t:Build /p:Configuration=Debug /p:Platform=“Any CPU” /p:TargetProfile=Local
# Run Scanner end step
SonarScanner.MSBuild.exe end
If that does not work as expected for some reason, please attach a file with the full console output of the above 3 commands for investigation
Your normal command to build your project is: MSBuild.exe “MPBuild.sln” /t:Clean /t:Build /p:Configuration=Debug /p:Platform=“Any CPU” /p:TargetProfile=Local
To wrap it with build wrapper, you need to “prepend” your command with build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory. This will run build-wrapper that will do a few preparation things and then execute your following build command as usual (and collect some information (that you don’t need to look at) in the build_wrapper_output_directory in the process)
So in your case you need to run: build-wrapper-win-x86-64.exe --out-dir build_wrapper_output_directory MSBuild.exe “MPBuild.sln” /t:Clean /t:Build /p:Configuration=Debug /p:Platform=“Any CPU” /p:TargetProfile=Local
Does you project compiles when you build it without SonarScanner and wrapper ?
This seems to me like a compilation problem, not a SonarQube problem.
I forgot to mention this implicit prerequisite that your code should compile before being able to analyze it !