C++ Eclipse 说参数无效(类型不正确)

标签 c++ eclipse warnings

代码是

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)));

但仍然给出相同的(红色下划线)错误/警告。

我可以访问函数的源代码

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 通常无法解决某些问题(出于各种原因),但这并不总是意味着代码是错误的

因此,只需保存项目或/并构建它。


另一个有时有效的技巧是:Project->Index->​​Rebuild 以强制 Eclipse 再次仔细查看所有内容 - credits: user4581301


由于此处没有最小示例,我们无法重现您所看到的内容。

关于C++ Eclipse 说参数无效(类型不正确),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36850544/

相关文章:

c++ - 在另一个函数中初始化后无法访问 main 中的全局数组

c++ - C++中的新行错误

java - "method must override or implement a superclass method"当我已经这样做的时候

c - 如果没有参数,为什么警告 C4131(旧式函数)不发出警告?

c - 重复符号和应用程序崩溃

c++ - 我可以告诉编译器考虑关闭关于返回值的控制路径吗?

C++ realloc same pointer warranty

c++ - C++中的堆栈溢出错误

c++ - Eclipse ide 需要与 MISRA 规则集成

linux - 使用 Eclipse 构建 FFmpeg - Linux