Dieses Video zeigt, wie einfach die Installation von wxWidgets unter FreeBSD geht.

wxWidgets ist einfach installierbar:
1 | pkg install wx31-gtk3 |
Hier das Beispielprogramm:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #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:
1 | c++ *.cpp -o mywxapp `wxgtk3u-3.1-config --libs --cppflags` -std=c++11 |
Folgendermaßen sieht es dann aus:
