There is no corresponding function to call (a link to a pointer instead of a pointer is expected)

I get an error from xcode (3.2.4) / gcc (4.0):

/Users/admin/scm/audacity/mac/../src/toolbars/DeviceToolBar.cpp: In member function 'void DeviceToolBar::ShowInputDialog()':
/Users/admin/scm/audacity/mac/../src/toolbars/DeviceToolBar.cpp:817: error: no matching function for call to 'DeviceToolBar::ShowComboDialog(wxChoice*&, wxString)'
/Users/admin/scm/audacity/mac/../src/toolbars/DeviceToolBar.h:74: note: candidates are: void DeviceToolBar::ShowComboDialog(wxChoice*, wxString&)

So it looks like it is expecting a pointer to a pointer in ShowComboDialog, but I don't know why, since the signatures are clearly normal pointers. Also, if he was expecting a pointer to a pointer, then, as I call it, should work. This is the first error, and there are no special warnings in front of it.

It is also a compilation in MSVC 2008 Express. Please give me the key.

//in the class def
//(only relevant portions included
class DeviceToolBar:public ToolBar {

 public:
   DeviceToolBar();
   virtual ~DeviceToolBar();
   void ShowInputDialog();
 private:
   void ShowComboDialog(wxChoice *combo, wxString &title);

   wxChoice *mInput;
};

//in the cpp file
void DeviceToolBar::ShowInputDialog()
{
   ShowComboDialog(mInput, wxString(_("Select Input Device")));
}

void DeviceToolBar::ShowComboDialog(wxChoice *combo, wxString &title)
{
//...
}
+3
source share
2 answers

; . wxString, . ++ const, . ShowComboDialog const .

+9

ShowComboDialog wxString , . const .

ShowComboDialog, (wxString), const (const wxString&), wxString, , , ( ) .

+4

Source: https://habr.com/ru/post/1788737/


All Articles