Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Eclipse says invalid arguments (type not correct)

The code is

g_CDioService->getDioPrjMgr()->NotifyBtMacAddress(std::string(path));

Declaration is

void NotifyBtMacAddress(const std::string &path);

Eclipse underlines NotifyBtMacAddress and says

Invalid arguments 'Candidates are: void NotifyBtMacAddress(const ? &)'

I've even tried to explicitly cast it to the type actually expected:

g_CDioService->getDioPrjMgr()->NotifyBtMacAddress(const_cast<const std::string & >(std::string(path)));

But still gives the same (red underlined) error/warning.

I have access to the source of the function

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.
...
like image 383
Bob Avatar asked Apr 25 '16 20:04

Bob


1 Answers

IDEs usually fail to resolve some things (for various reasons), but that does not always mean that the code is wrong.

So, just save the project or/and build it.


Another trick that sometimes works is: Project->Index->Rebuild to force Eclipse to take a good look at everything again - credits: user4581301


Since there is no minimal example here, we cannot reproduce what you are seeing.

like image 200
gsamaras Avatar answered Sep 17 '22 04:09

gsamaras