1.安装MSYS2
2.在MSYS2中安装wxWidgets
3.测试代码如下:
#include <wx/wx.h>
class Simple : public wxFrame
{
public:
Simple(const wxString& title);
};
Simple::Simple(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150))
{
Centre();
}
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
Simple *simple = new Simple(wxT("Simple"));
simple->Show(true);
return true;
}
4. 动态编译
g++ Hello.cpp `wx-config --cxxflags --libs` -o hello
5. 静态编译
g++ -static Hello.cpp `wx-config --cxxflags --libs --static` -o hello