没有匹配函数错误 no matching function
函数原型:void func1(string&, string&);
调用方式:func1(string("parameter1", "parameter2"));
错误类型:VS正常,SunStudio正常,GCC报告函数原型不匹配,如下:
PointDataCtrl.cpp:230: error: no matching function for call to‘QUOTESERVER::DATACTRL::CQuoteCtrl::SendMQMsg(std::string&, std::string)’
QuoteCtrl.h:83: note: candidates are: void QUOTESERVER::DATACTRL::CQuoteCtrl::SendMQMsg(std::string&, std::string&)
需改为:
string parameter1("p1"), parametre2("p2");
func1(parameter1, parametre2));
就正常了。
谁帮我看看是什么问题?谢谢