Author Topic: Help setting up wxWidgets  (Read 11558 times)

Offline apo

  • Single posting newcomer
  • *
  • Posts: 1
Re: Help setting up wxWidgets
« Reply #15 on: July 05, 2018, 09:44:59 am »
This thread is ancient (13+ years old), but here is a fix for you anyway:


class HelloWorldApp : wxApp


class HelloWorldApp : public wxApp

and you are good to go.

Hello everyone.

I'm trying to learn how to use wxWidgets using 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:

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

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

Code: [Select]
#include "wx/wx.h"

class HelloWorldApp : wxApp
    virtual bool OnInit();


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

    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?