News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Help setting up wxWidgets

Started by Xorlium, April 23, 2005, 03:34:23 PM

Previous topic - Next topic

apo

This thread is ancient (13+ years old), but here is a fix for you anyway:

Change:

class HelloWorldApp : wxApp

into

class HelloWorldApp : public wxApp

and you are good to go.

Quote from: Xorlium on April 23, 2005, 03:34:23 PM
Hello everyone.

I'm trying to learn how to use wxWidgets using www.3dbuzz.com C++ Video training. They show you how to install wxwidgets, and what you need to do before using it. The thing is, they use Visual Studio, not Code::Blocks, and I can't exactly follow along the setup.

At some point in time, they go to "Project Properties->C/C++->Preprocesor" and then add:
wxUSE_GUI=1; _WXDEBUG_; WXDEBUG=1

And I can't find "preprocesor" anywhere on codeblocks :)

I tried going along, but... let me show you my code.


#include "wx/wx.h"

class HelloWorldApp : wxApp
{
public:
    virtual bool OnInit();
};

IMPLEMENT_APP(HelloWorldApp)

bool HelloWorldApp::OnInit()
{
    wxFrame *frame = new wxFrame((wxFrame *) NULL, -1, _T("Hello World!"), wxPoint(60,70), wxSize(500,600));
   
    frame->Show(TRUE);

    SetTopWindow(frame);
   
    return true;
}


if I try to compile it, it gives me this error:
'wxAppConsole is an inaccessible base of HelloWorldApp', and it says it's on the
IMPLEMENT_APP(HelloWorldApp) line, so I imagine it has something to do with the preprocesor. I don't know, though.

Can someone help me?

Thanks!!