01 - 编译链接第一个wxWidgets3.0例子
1. preprocessor
#define __WXMSW__
#define WXUSINGDLL
2. vc10中设置Include dir, lib dir, dll path
VC++平台编译完的lib 和DLL都在这个目录下 C:\Programs\wxWidgets-3.0.0\lib\vc_dll
3. HelloWorld源代码
// wxWidgets "Hello world" Program
// For compilers that support precompilation, includes "wx/wx.h".
#define __WXMSW__
#define WXUSINGDLL
#include <wx/wx.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 =
};
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(, ), wxSize(, ) );
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!");
}
第一个程序很简单,应该不会出什么错误.
01 - 编译链接第一个wxWidgets3.0例子的更多相关文章
- linux学习之编译-链接
在Windows下使用习惯了IDE,导致我们对程序的编译链接没有一个清晰的认识,甚至混淆了编辑器和编译器的概念.在学习Linux时,这些问题就暴露出来了. 实际上,我们应该严格区分一个程序从产生到执行 ...
- CodeBlocks16.01+wxWidgets3.0.2
[环境] windows7 x64,CodeBlocks16.01,wxWidgets3.0.2 [步骤] 一.下载所需的文件: 1.codeblocks官网:http://www.codeblock ...
- Mingw64编译wxWidgets3.0.2常见错误
使用Mingw64编译wxWidgets3.0.2,首先得下载wxMSW-Setup-3.0.2.exe(https://sourceforge.net/projects/wxwindows/file ...
- 在Code::Blocks中编译和使用wxWidgets3.0.0教程
跳转至:指南,搜索 注意,编译Code :: Blocks的对wxWidgets的3.0.0链接不是很稳定,但该库至少可以被正确编译,(只是使用的时候可能会有问题):CodeBlocks开发商都在 ...
- 实现一个基于tcc/tlink的简单的编译链接工具
一.基础研究 在这里我们需要提供一套新的c语言开发工具cc,它支持的c程序不是从main开始运行而是从CMain开始运行. 书上已经对该工具程序进行了需求分析:(1)要在屏幕中间显示彩色的字符串:(2 ...
- 编译 wxWidgets-3.0.2 on Mac OS X Yosemite 出错?!的解决方法
tar -zxf wxWidgets-3.0.2.tar.bz2 //解压 //三部走 ./configure ./make 提示webKit出错 原因:有人偷懒,没试编译就发布了. 解决:找到. ...
- GCC编译链接过程
编译链接过程 代码 #cat main.c #include <stdio.h> int add(int x, int y); int sub(int x, int y); int mul ...
- 编译调试 .NET Core 5.0 Preview 并分析 Span 的实现原理
很久没有写过 .NET Core 相关的文章了,目前关店在家休息所以有些时间写一篇新的
- C/C++编译链接过程详解
有些人写C/C++(以下假定为C++)程序,对unresolved external link或者duplicated external simbol的错误信息不知所措(因为这样的错误信息不能定位到某 ...
随机推荐
- Ubuntu系统下允许Apache的mod_rewrite功能
首先,使能apache的rewirte模块,在shell里输入下边的命令: sudo a2enmod rewrite 然后重启一下webserver使更改生效 sudo service apache2 ...
- c++11: bind用法
原型: template< class R, class F, class... Args > bind( F&& f, Args&&... args ); ...
- 用CSS实现Firefox 和IE 都支持的Alpha透明效果
有的时候,为了实现一些特殊效果,需要将页面元素变透明,本文介绍的就是用 CSS 实现 Firefox 和 IE 都支持的 Alpha 透明效果.CSS: filter:alpha(opacity=50 ...
- Yii2框架数据库增删改查小结
User::find()->all(); //返回所有用户数据:User::findOne($id); //返回 主键 id=1 的一条数据: User::find()->wh ...
- Win10环境下的Scrapy结合Tor进行匿名爬取
本文内容来源:http://blog.privatenode.in/torifying-scrapy-project-on-ubuntu/ 在使用Scrapy的时候,一旦进行高频率的爬取就容易被封IP ...
- MySQL多实例-精典故障案例
很久以前搭建过MySQL多实例,记得当时很顺利,呵呵!今天公司因为业务需要,我再一次搭建多实例.安装完MySQL后,初始化两个实例时,出现如下报错: 150915 1:10:36 [ERROR] C ...
- 利用Jmeter做接口测试
本文作者:大道测试团队-孙云 1.在安装jmeter之前先配置好JDK,再配置jmeter环境变量. 2.启动jmeter 启动jmeter: 双击Jmeter解压路径(apache-jmeter-3 ...
- openerp 常见问题 OpenERP在哪储存附件?(转载)
OpenERP在哪储存附件? 原文地址:http://cn.openerp.cn/where_to_store_attachement_in_openerp_7/ 我们知道对OpenERP中的每个内部 ...
- 12、在XAML中定义处理程序
<Grid> <Button x:Name="btnTest" Width="120" Height="36" Conte ...
- github客户端创建仓库
1.在github上创建立自己项目仓库 登录后,在github首页,点击页面右下角“New Repository” 填写项目信息: project name: project description ...