没有匹配的方法编译错误

时间:2015-11-02 09:53:45

标签: c++ compilation

我正在尝试用C ++语言调用方法。

这是方法防御

  static responseID
  sell(ToteGateway* toteToUse,
       gdi_t gdi,
       char* accountID,
       int pin,
       int card,
       int race,
       pennies* stake,
       int betType,
       runnerList* legRunners,
       int numLegs,
       pennies* ticketCost,
       pennies* salesTax,
       pennies* accessCharge,
       tfaddress* sellAddress,
       pennies* availableBalance,
       char* tsnNumber,
       pennies* holdBalance,
       pennies initial_balance,
       char force_to_one_leg,
       char* yourSerialNumber,
       int64_t* cisTktID,
       char* cisAlias,
       uint32_t spfavs);

这就是我如何称呼它

 returnValue = Account::sell(toteGateway, myGdi, accountID, pin, card, race, stake,
           nBetType, theRunners, numLegs, &ticketCost, &salesTax, &accessCharge, &sellAddress,
           &availableBalance, (char*)&theTkt, &holdBalance, 1,yourSerialNumber,cisTktID,cisAlias,spfavs);
      LOG_DEBUG_MSG(" After Executing  Account::sell");

添加最后4个参数后出现以下错误,这里是我传递的值,如

  char* yourSerialNumber = (char*)ns1__accountSell->yourSerialNumber.c_str();
      int64_t cisTktID = (int64_t)ns1__accountSell->cisTktID;
      char* cisAlias =(char*)ns1__accountSell->cisAlias.c_str();
      uint32_t  spfavs = ns1__accountSell->spfavs;

将这些值传递给方法。我最终得到了像

这样的错误
  

src / atlserverservice.cpp:1360:错误:没有匹配函数来调用'Account :: sell(ToteGateway *&,uint32_t&,char *&,int&,int&,int&,pennies&, int&,runnerList [10],int&,pennies *,pennies *,pennies *,tfaddress *,pennies *,char *,pennies *,int,char *&,int64_t *,char *&,uint32_t *) “

     

Account.h:509:注意:候选人是:static responseID Account :: sell(ToteGateway *,gdi_t,char *,int,int,int,pennies,int,runnerList *,int,pennies *,pennies *,便士*,tfaddress *,便士*,char *,便士*,便士,char)

     

Account.h:567:注意:静态responseID Account :: sell(ToteGateway *,gdi_t,char *,int,int,int,pennies *,int,runnerList *,int,pennies *,pennies *,pennies * ,tfaddress *,pennies *,char *,pennies *,pennies,char,char *)

     

Account.h:591:注意:静态responseID Account :: sell(ToteGateway *,gdi_t,char *,int,int,int,pennies *,int,runnerList *,int,pennies *,pennies *,pennies * ,tfaddress *,pennies *,char *,pennies *,pennies,char,char *,int64_t *,char *)

     

Account.h:616:注意:静态responseID Account :: sell(ToteGateway *,gdi_t,char *,int,int,int,pennies *,int,runnerList *,int,pennies *,pennies *,pennies * ,tfaddress *,pennies *,char *,pennies *,pennies,char,char *,int64_t *,char *,uint32_t)

     

Account.h:633:注意:静态responseID Account :: sell(ToteGateway *,gdi_t,char *,int,int,int,int,wager_data *,int,pennies *,pennies *,pennies *,char * ,tfaddress *,便士*)

可能是什么原因?

1 个答案:

答案 0 :(得分:1)

您需要使用&cisTktID传递地址而不是值。