wxCrafter Hello World not working [Solved]

General questions regarding the usage of CodeLite
var_null
CodeLite Curious
Posts: 9
Joined: Fri Feb 28, 2020 5:54 am
Genuine User: Yes
IDE Question: C++
Contact:

wxCrafter Hello World not working [Solved]

Post by var_null »

I followed the wxCrafter Hello World tutorial: https://wiki.codelite.org/pmwiki.php/Ma ... HelloWorld

Building process shows no errors, however no dialog shows up when I click "Build->Run"

main.cpp:

Code: Select all

#include <wx/app.h>
    #include <wx/event.h>
    #include "MainDialog.h"
    #include <wx/image.h>


    // Define the MainApp
    class MainApp : public wxApp
    {
    public:
        MainApp() {}
        virtual ~MainApp() {}

        virtual bool OnInit() {
            // Add the common image handlers
            wxImage::AddHandler( new wxPNGHandler );
            wxImage::AddHandler( new wxJPEGHandler );

            MainDialog mainDialog(NULL);
            mainDialog.ShowModal();
            return false;
        }
    };

    DECLARE_APP(MainApp)
    IMPLEMENT_APP(MainApp)
MainDialog.h:

Code: Select all

 #ifndef MAINDIALOG_H
    #define MAINDIALOG_H
    #include "wxcrafter.h"

    class MainDialog : public MainDialogBaseClass
    {
    public:
        MainDialog(wxWindow* parent);
        virtual ~MainDialog();
    protected:
        virtual void OnButtonokButtonClicked(wxCommandEvent& event);
    };
    #endif // MAINDIALOG_H
MainDialog.cpp:

Code: Select all

 #include "MainDialog.h"
    #include <wx/msgdlg.h> 

    MainDialog::MainDialog(wxWindow* parent)
        : MainDialogBaseClass(parent)
    {
    }

    MainDialog::~MainDialog()
    {
    }

    void MainDialog::OnButtonokButtonClicked(wxCommandEvent& event)
    {
        ::wxMessageBox(_("Hello World"));
    }
Last edited by var_null on Fri Feb 28, 2020 11:51 pm, edited 1 time in total.
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: wxCrafter Hello World not working

Post by DavidGH »

Hi,

I see from your StackOverflow post that you're using CodeLite 13.0 on debian, and that Hello World does run correctly in a terminal. So it's likely to be a problem with your Workspace/Project settings, or your terminal settings.

First, open the Settings > Preferences menu and select the 'Terminal' tab. Which terminal is set? Does it exist on your system? If not (or even if it does), try switching to 'codelite-terminal' as that's definitely available. Does 'Run' work now?

If not, have a look at your Project settings: the Spanner icon in the Workspace View. Do the 'Intermediate Directory' and the 'Executable to Run/Debug' settings look sane?

Regards,

David
var_null
CodeLite Curious
Posts: 9
Joined: Fri Feb 28, 2020 5:54 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxCrafter Hello World not working

Post by var_null »

Hello, thanks for your reply

I think I need to solve another problem before continuing to check the one from this thread:

I've set the terminal to codelite-terminal and I'm getting the following output when trying to build, even when I've modified and saved the project files since the last build:

Code: Select all

/bin/sh -c '/usr/bin/make -j4 -e -f  Makefile'
----------Building project:[ MedCen_Plus - Debug ]----------
make[1]: Entering directory '/home/user/CProjects/Workspace/MedCen_Plus'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/user/CProjects/Workspace/MedCen_Plus'
====0 errors, 0 warnings====
I've already deleted the Debug folder, and the problem is still there

I copied the files to a Eclipse CTD project and the files do build fine with Eclipse, however I'd like to fix this "Nothing to be done for 'all'." problem so I can continue working on CodeLite, prefer CodeLite because of wxCrafter

I guess I need to make a new thread for this other problem, so I'll do that and later check on this one

Edit: everything works fine now, both issues solves, my project settings were the problem: viewtopic.php?f=11&t=4403
Post Reply