C++ Eclipse 说参数无效(类型不正确)
C++ Eclipse says invalid arguments (type not correct)
密码是
g_CDioService->getDioPrjMgr()->NotifyBtMacAddress(std::string(path));
声明为
void NotifyBtMacAddress(const std::string &path);
Eclipse 下划线 NotifyBtMacAddress
并表示
Invalid arguments 'Candidates are: void NotifyBtMacAddress(const ? &)'
我什至尝试将其显式转换为实际预期的类型:
g_CDioService->getDioPrjMgr()->NotifyBtMacAddress(const_cast<const std::string & >(std::string(path)));
但还是一样(红色下划线)error/warning.
我可以访问函数的源代码
void CDioPrjMgr::NotifyBtMacAddress(const std::string &path){
// PASLOG(ZONE_FUNC, __FUNCTION__, "Sequence: PRJ_DIO -> PRJ_Manager : Send BT MAC ADdress");
// On recving Disable BT command, Send Mac Addres to Mgr.
...
IDE 通常无法解决某些问题(出于各种原因),但并不总是意味着代码错误。
所以,只需保存项目 or/and 构建它。
另一个有时有效的技巧是:Project->Index->Rebuild 以强制 Eclipse 再次仔细查看所有内容 - 致谢:user4581301
由于此处没有最小示例,我们无法重现您所看到的内容。
密码是
g_CDioService->getDioPrjMgr()->NotifyBtMacAddress(std::string(path));
声明为
void NotifyBtMacAddress(const std::string &path);
Eclipse 下划线 NotifyBtMacAddress
并表示
Invalid arguments 'Candidates are: void NotifyBtMacAddress(const ? &)'
我什至尝试将其显式转换为实际预期的类型:
g_CDioService->getDioPrjMgr()->NotifyBtMacAddress(const_cast<const std::string & >(std::string(path)));
但还是一样(红色下划线)error/warning.
我可以访问函数的源代码
void CDioPrjMgr::NotifyBtMacAddress(const std::string &path){
// PASLOG(ZONE_FUNC, __FUNCTION__, "Sequence: PRJ_DIO -> PRJ_Manager : Send BT MAC ADdress");
// On recving Disable BT command, Send Mac Addres to Mgr.
...
IDE 通常无法解决某些问题(出于各种原因),但并不总是意味着代码错误。
所以,只需保存项目 or/and 构建它。
另一个有时有效的技巧是:Project->Index->Rebuild 以强制 Eclipse 再次仔细查看所有内容 - 致谢:user4581301
由于此处没有最小示例,我们无法重现您所看到的内容。