wxRichTextCtrl return is private error [Solved]

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
windowbow
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Feb 02, 2018 7:32 am

wxRichTextCtrl return is private error [Solved]

Post by windowbow »

Hi,

I've just set up wxWidget in codeBlock and the samples work fine.
I want to use in my application wxRichTextControl but initializing such an object returns the following error :

Code: Select all

||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
/usr/local/include/wx-3.0/wx/control.h|220|error: ‘wxControlBase::wxControlBase(const wxControlBase&)’ is private|
/usr/local/include/wx-3.0/wx/defs.h|3534|note: in definition of macro ‘wxDECLARE_NO_COPY_CLASS’|
/usr/local/include/wx-3.0/wx/gtk/control.h|20|error: within this context|
/usr/local/include/wx-3.0/wx/richtext/richtextctrl.h|214|note: synthesized method ‘wxControl::wxControl(const wxControl&)’ first required here |
/usr/local/include/wx-3.0/wx/textctrl.h|662|error: ‘wxTextCtrlIface::wxTextCtrlIface(const wxTextCtrlIface&)’ is private|
/usr/local/include/wx-3.0/wx/defs.h|3534|note: in definition of macro ‘wxDECLARE_NO_COPY_CLASS’|
/usr/local/include/wx-3.0/wx/richtext/richtextctrl.h|214|error: within this context|
/usr/local/include/wx-3.0/wx/gtk/scrolwin.h|75|error: ‘wxScrollHelper::wxScrollHelper(const wxScrollHelper&)’ is private|
/usr/local/include/wx-3.0/wx/defs.h|3534|note: in definition of macro ‘wxDECLARE_NO_COPY_CLASS’|
/usr/local/include/wx-3.0/wx/richtext/richtextctrl.h|214|error: within this context|
/home/gregoire/Projet/ProjetPerso/PrepSimulator/test/testMain.cpp||In constructor ‘testFrame::testFrame(wxFrame*, const wxString&)’:|
/home/gregoire/Projet/ProjetPerso/PrepSimulator/test/testMain.cpp|59|note: synthesized method ‘wxRichTextCtrl::wxRichTextCtrl(const wxRichTextCtrl&)’ first required here |
/usr/local/include/wx-3.0/wx/richtext/richtextctrl.h|251|note:   after user-defined conversion: wxRichTextCtrl::wxRichTextCtrl(wxWindow*, wxWindowID, const wxString&, const wxPoint&, const wxSize&, long int, const wxValidator&, const wxString&)|
||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
I only modified the the app.cpp of the sample :

Code: Select all

#ifdef WX_PRECOMP
#include "wx_pch.h"
#endif

#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

#include "testApp.h"
#include "testMain.h"

IMPLEMENT_APP(testApp);

bool testApp::OnInit()
{
    testFrame* frame = new testFrame(0L, _("wxWidgets Application Template"));
    
     //Here is the line I added
   [color=#FF0000] wxRichTextCtrl test = 0;[/color]
    frame->Show();

    return true;
}
I thought the problem was that i did not set up the libraries that Richtextcontrol need, but setting up the monolithic build did not solve the problem.

Thanks.
Last edited by windowbow on Fri Feb 02, 2018 9:29 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxRichTextCtrl return is private error

Post by doublemax »

Code: Select all

wxRichTextCtrl test = 0;
That line doesn't make any sense. The control must be created on the heap and you must pass proper parameters to it, at the very least the parent window.

http://docs.wxwidgets.org/trunk/classwx ... fd68c8a4fa

Then you should put it into a sizer, so that it resizes automatically with the frame.
Use the source, Luke!
windowbow
In need of some credit
In need of some credit
Posts: 2
Joined: Fri Feb 02, 2018 7:32 am

Re: wxRichTextCtrl return is private error

Post by windowbow »

typo error, it was supposed to be a pointer that I did not initialized to see if it could recognize the class.
It works fine by putting the good parameters, thank you !

Problem Solved
Post Reply