c++msbuildsonarqubeparsing-error

Getting parsing error with c++ plugin using macros


I have the following code in my .cpp:

STDMETHODIMP CChildFrame::raw_StateChanged(long _lIndex)
{
    return S_OK;
}

and I have the following code in my .h:

STDMETHOD(raw_StateChanged)(long _lIndex);

I am using build-wrapper with MSBuild.

When I am using sonar-runner analyser it gives me the errors:

Unable to parse file...

RecognitionException : Parse error at line...


Solution

  • The define _WIN32 is missing, I don't now why. You need to add: sonar.cfamily.predefinedMacros=#define _WIN32.