c ++代码中的参数不匹配错误

时间:2011-12-21 04:59:31

标签: c++

我有三个文件,第一个是bmptktevent.h,第二个是bmptktevent.c,第三个是sbsngenerator.pC文件。我必须添加一个属性IPAddr。我已经在这三个文件中添加了IPAddr但是当我编译它时它会给出错误

  

SbsnEvtGenerator.C”,线2107:错误:找不到BMPTktClearanceEvt :: BMPTktClearanceEvt(常量cpInstanceId,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone匹配,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,cpAttrClone,const cpAttribute,const cpAttribute,const cpAttribute,const cpAttribute,cpAttribute,cpAttribute,cpAttribute,cpAttribute,cpAttribute *,cpAttribute *,cpAttribute *,cpAttribute *,cpAttribute *,cpAttribute)

我正在附上这三个文件。请帮我解决这个问题。 我已经对这三个文件进行了更改。第一个是

SbsnEvtGenerator.pC 
cpAttribute *IPAddr = _grabAttr( extraAttrs, BMPMO_IPAddress);

case IPAddressChangeEvt :
        {
            supTDO << setdl( TKT_TR_INFO ) << "Trying to "
            << "create a IPAddressChangeEvt object..."
            << endsup;

            FailIfAttrIsNull( IPAddr, BMPMO_IPAddress );

            tktEvt = new BMPTktIPAddressChangeEvt(
                    // S.Liou 01/13/98 : bmp980015.04
                    //  trblTktId, acMCN, acTktSrc,
                    trblTktId, acMCN,
                    acCGWSbsnValue, acserviceCode, 
                    actier1, actier2, actos, acbesban,
                    accustIdType, accustIdValue,acIPCustId,acDomainName, //EM_LOCAL_2
                    acserviceIdType,accustTicketNumber,acbridgeSysTktId,
                     acTktSrc,    //bmp021267.08
                    // End of bmp980015.04 [S.Liou]
                    *atLoginId, *atWkCtrId,
                    //Sameer...bmp983284.11
                                            attrAutoIndicator,
                    *IPAddr );

在bmptkt event.h中

class BMPTktIPAddressChangeEvt: public BMPTktEvent
{
public:
BMPTktIPAddressChangeEvt()
  {type=IPAddressChangeEvt;}
BMPTktIPAddressChangeEvt(const cpInstanceId& tktId,
    const cpAttribute& MCN,
    const cpAttribute& cgwSbsn, //bmp980015
    const cpAttribute& serviceCode, // bmp011771
    const cpAttribute& tier1, // bmp011771.05
    const cpAttribute& tier2, // bmp011771.05
    const cpAttribute& typeOfService,   //ASV R23.0  //bmp020785.06
    const cpAttribute& BESBAN, // R24.0 EM Local #bmp021233.23
    const cpAttribute& CustIdType,  //EM_LOCAL_2
    const cpAttribute& CustIdValue, //EM_LOCAL_2
    const cpAttribute& IPCustId,
            const cpAttribute& DomainName,
    const cpAttribute& serviceIdType, //IP Cable #bmp021267    R24.0
    const cpAttribute &custTicketNumber,
    const cpAttribute &bridgeSysTktId,
    const cpAttribute& srcSys, const cpAttribute& loginId,
    const cpAttribute& workCenter,
    const cpAttribute& autoInd,  //Sameer...bmp983284.14
    const cpAttribute& IPAddr ) ;
};

和bmptktevent.C

1 个答案:

答案 0 :(得分:3)

  

错误:无法找到BMPTktClearanceEvt :: BMPTktClearanceEvt([...] cpAttribute, cpAttribute *,cpAttribute *,cpAttribute *,cpAttribute *,cpAttribute * ,cpAttribute)

注意第六到第二个是指针。你没有足够的解除引用:

// these are the last 6 parameters you're passing:
acbridgeSysTktId,
acTktSrc,    //bmp021267.08
// End of bmp980015.04 [S.Liou]
*atLoginId, *atWkCtrId,
//Sameer...bmp983284.11
attrAutoIndicator,
*IPAddr

看看是否有任何双指针。此外,您实际传递的前几个参数是cpAttrClone。那些可以隐式转换为cpAttribute吗?如果没有,那也是错误的来源。