Skip to main content
Hi
My code is working fine with FME Desktop 2014 but having error while compiling it with FME Desktop 2020 with below error
error C2259: 'CtFunction': cannot instantiate abstract class as the IFMEFunction::execute is deprecated and need to upgrade it.

Hello @neerajm2​ , thanks for posting! Is this error coming from a workspace or code? If code, what language are you using? Also, may I ask what your workspace or code is trying to do? It looks like something you're using may have been deprecated since FME 2014? Best, Kailin.


Hi @kailinatsafe​ 

Thanks for your response

The error is in a .cpp file of my workspace , in my source code i have created the function like this

FME_MsgNum CtFunction::execute(IFMEFeature& feature,

          const IFMEStringArray &parameterList,

          IFMEString &returnValue)

{

  gLogFile->logMessage(kMessage0,parameterList);

  FME_Real64 xSum = 0;

  FME_Real64 ySum = 0;

  FME_Real64 zSum = 0;

  FME_UInt32 coordNum = 0;

  for (coordNum = 0; coordNum < feature.numCoords(); coordNum++)

  {

    FME_Real64 xValue = 0; 

    FME_Real64 yValue = 0;

    FME_Real64 zValue = 0;

    if (feature.getDimension() == 3)

    {

       feature.getCoordinate(coordNum,

                  xValue, 

                  yValue, 

                  zValue);

    }

    else

    {

       feature.getCoordinate(coordNum,

                  xValue, 

                  yValue);

    }

    xSum += xValue;

    ySum += yValue;

    zSum += zValue;

  }

 

  FME_UInt32 originalNumCoords = feature.numCoords();

  feature.resetCoords();

  feature.addCoordinate(xSum / originalNumCoords,

             ySum / originalNumCoords,

             zSum / originalNumCoords);

 

   feature.setGeometryType(FME_GEOM_POINT);

  returnValue = "howdy";

  return 0;

}

now i have to upgrade it for FME Desktop 2020.


Reply