| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. Compiler error for constructor of my implementation of wxFrame class #2433 Posted by: 2003-08-05 11:46:14 | Can someone help me? I am getting the following errors while compiling.
12 D:devcpp_projwx_hello_worldtextframe.cpp ISO C++ forbids defining types within return type 12 D:devcpp_projwx_hello_worldtextframe.cpp return type specification for constructor invalid 12 D:devcpp_projwx_hello_worldMakefile.win [Build Error] [textframe.o] Error 1
My code is attached below. The offending line of code seems to be:
textframe::textframe(const wxChar* title, int xpos, int ypos, int width, int height) :wxFrame((wxFrame*) NULL, -1, title, wxPoint(xpos,ypos), wxSize(width, height))
I have no idea what is wrong. Can someone please explain?
//textframe.h //-------------- #ifndef TEXTFRAME_H #define TEXTFRAME_H
class textframe : public wxFrame { public: //constructor textframe(const wxChar* title, int xpos, int ypos, int width, int height); //destructor ~textframe(); }
#endif //TEXTFRAME_H
//textframe.cpp //---------------- #include "wx/wxprec.h"
#ifndef WX_PRECOMP #include "wx/wx.h" #endif
//headers #include "textframe.h"
textframe::textframe(const wxChar* title, int xpos, int ypos, int width, int height) :wxFrame((wxFrame*) NULL, -1, title, wxPoint(xpos,ypos), wxSize(width, height)) { }
textframe::~textframe() { } | 2. Re: Compiler error for constructor of my implementation of wxFrame class #2434 | Why not the title is wxString according to wxmsw241 doc?
wxFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "frame") | 3. Re: Compiler error for constructor of my implementation of wxFrame class #2437 Posted by: 2003-08-05 12:10:12 | I don't really know about the wxString. I am just following the wxTutorial pdf. i'll have to go take a look at the document file.
Holy Jeebuz! i found out my mistake. I forgot the semicolon after my class declaration.
class textframe:: public wxFrame { ........ };
jeebuz what a wild goose chase. | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|