In diesem Video zeige ich, wie man wxWidgets unter Linux, in unserem Szenario Ubuntu, installieren kann.

Installiert werden kann wxWidgets folgendermaßen:
sudo apt install libwxgtk3.0-gtk3-dev
Hier der Quellcode von unserer Test-Anwendung:
#include <wx/wx.h>
class MyApp : public wxApp {
public:
bool OnInit();
};
class MyFrame : public wxFrame {
public:
MyFrame();
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit() {
MyFrame *myFrame = new MyFrame;
myFrame->Show();
SetTopWindow(myFrame);
return true;
}
MyFrame::MyFrame() : wxFrame(nullptr, wxID_ANY, "Meine wx-App") {
wxStaticText *staticText = new wxStaticText(this, wxID_ANY, "Hello World");
}
Und so wird es kompiliert:
c++ mywxapp.cpp -o mywxapp `wx-config --libs --cppflags` -std=c++11
Danach sieht es in etwa so aus:
