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

标签 c++

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

SbsnEvtGenerator.C", line 2107: Error: Could not find a match for BMPTktClearanceEvt::BMPTktClearanceEvt(const 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 中

最佳答案

Error: Could not find a match for 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 吗?如果不是,这也是错误的来源。

关于c++ - C++ 代码中的参数不匹配错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8585255/

相关文章:

c++ - OpenCV C++ 接口(interface)上的 CamShift 问题

c++ - C/C++ 中的引导加载程序?

c++ - VSPerf VS2010 和其他分析工具没有获取 pdb

c++ - 类中已删除的析构函数显示为虚拟/直接基类或一种非静态数据成员

c++ - C++ 中的 constexpr int 和 constexpr double

c++ - 可以使用 Boost.Hana 将 std::array 解压缩到非类型模板参数包中吗?

c++ - 找不到运行时检查失败的根源 #2

c++ - 使用 ImageMagick++ 捕获 X11 屏幕截图

C++ STL,常量迭代器,find()

c++ - 涉及 QEventPrivate 的编译器错误?