Author Topic: No matching function?  (Read 4887 times)

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
No matching function?
« on: February 04, 2007, 10:01:19 pm »
Hey,

This might be more or less just wxWidgets, but every time I add a widget with, lets say for wxStaticText, ...

Code
WxStaticText1 = new wxStaticText(this, ID_WXSTATICTEXT1, wxPoint (10,10), wxDefaultSize, wxLC_REPORT);

and

Code
#include <wx/stattext.h>

...and...

Code
wxStaticText *WxStaticText1;

AND...

Code
ID_WXSTATICTEXT1 = 1017,

I just get the message:

Quote
error: no matching function for call to 'wxStaticText::wxStaticText(MUMSFrm *const, MUMSFrm::<anonymous enum>, wxPoint, const wxSize&, int)'

Something I'm missing?

Thanks!
FlyingIsFun1217

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: No matching function?
« Reply #1 on: February 04, 2007, 10:46:10 pm »
Here is the prototype for the wxStaticText constructor:
Code
wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "staticText")
Your code, therefore, is both skipping the label parameter and, apparently, trying to pass a const pointer as the (non-const) parent parameter. (Maybe you're within a const member function?)

That aside, the Code::Blocks forums are for posting about issues specifically related to Code::Blocks, and unless the code in question is being automatically generated by wxSmith, this issue is specifically related to wxWidgets, not C::B.
« Last Edit: February 04, 2007, 10:49:34 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: No matching function?
« Reply #2 on: February 04, 2007, 11:14:52 pm »
Alright, I'll post at the wxForum's.

FlyingIsFun1217