Windows10 vs2015 编译wxWidgets

wxWidgets is a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base. It has popular language bindings for Python,PerlRuby and many other languages, and unlike other cross-platform toolkits, wxWidgets gives applications a truly native look and feel because it uses the platform's native API rather than emulating the GUI. It's also extensive, free, open-source and mature.

 

官网:https://www.wxwidgets.org/

 

下载对应包

进入wxWidgets目录

本人是  E:\wxWidgets-3.1.2\build\msw

 

vs2015打开 wx_vc14.sln

 

本人用的 /MT  所以 项目 c++ 生成代码  运行库 选择 多线程/MT

 

然后编译出来后得到 23个lib

 

然后加载到项目  

 

链接库 里面 输入 

 

include 就是wxWidgets里面的include  然后把 编译出来的 E:\wxWidgets-3.1.2\lib\vc_x64_lib\mswu\wx 下面的 setup.h copy到

E:\wxWidgets-3.1.2\include\wx下面

到此就可以了。

可以试试例子  当然就是 hello world

wxbase31u.lib
wxbase31u_net.lib
wxbase31u_xml.lib
wxexpat.lib
wxjpeg.lib
wxmsw31u_adv.lib
wxmsw31u_aui.lib
wxmsw31u_core.lib
wxmsw31u_gl.lib
wxmsw31u_html.lib
wxmsw31u_media.lib
wxmsw31u_propgrid.lib
wxmsw31u_qa.lib
wxmsw31u_ribbon.lib
wxmsw31u_richtext.lib
wxmsw31u_stc.lib
wxmsw31u_webview.lib
wxmsw31u_xrc.lib
wxpng.lib
wxregexu.lib
wxscintilla.lib
wxtiff.lib
wxzlib.lib
winmm.lib
comctl32.lib
rpcrt4.lib
wsock32.lib
wininet.lib
#include <stdio.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include <wx/wxprec.h>

class MyApp : public wxApp
{
public:
	virtual bool OnInit();
};
class MyFrame : public wxFrame
{
public:
	MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
private:
	void OnHello(wxCommandEvent& event);
	void OnExit(wxCommandEvent& event);
	void OnAbout(wxCommandEvent& event);
	wxDECLARE_EVENT_TABLE();
};
enum
{
	ID_Hello = 1
};
wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(ID_Hello, MyFrame::OnHello)
EVT_MENU(wxID_EXIT, MyFrame::OnExit)
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
wxEND_EVENT_TABLE()
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
	MyFrame *frame = new MyFrame("Hello World", wxPoint(50, 50), wxSize(450, 340));
	frame->Show(true);
	return true;
}
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
	: wxFrame(NULL, wxID_ANY, title, pos, size)
{
	wxMenu *menuFile = new wxMenu;
	menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
		"Help string shown in status bar for this menu item");
	menuFile->AppendSeparator();
	menuFile->Append(wxID_EXIT);
	wxMenu *menuHelp = new wxMenu;
	menuHelp->Append(wxID_ABOUT);
	wxMenuBar *menuBar = new wxMenuBar;
	menuBar->Append(menuFile, "&File");
	menuBar->Append(menuHelp, "&Help");
	SetMenuBar(menuBar);
	CreateStatusBar();
	SetStatusText("Welcome to wxWidgets!");
}
void MyFrame::OnExit(wxCommandEvent& event)
{
	Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& event)
{
	wxMessageBox("This is a wxWidgets' Hello world sample",
		"About Hello World", wxOK | wxICON_INFORMATION);
}
void MyFrame::OnHello(wxCommandEvent& event)
{
	wxLogMessage("Hello world from wxWidgets!");
}

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值