vs2008 配置 wxwidgets 环境
2010-10-13 14:31
246 查看
1 、去官网 http://www.wxwidgets.org/downloads 下载一个wxMSW版本的 wxWidgets 。
有安装版和 压缩版的, 我这采用当时最新的 wxMSW-2.8.11
2、解压或者安装源文件包
假如路径是: D:/wxMSW-2.8.11
3、编译
用vs2008打开 D:/wxMSW-2.8.11/build/msw/wx.dsw
然后出现转换工程的界面,选择全部。
然后,配置编译的模式,如下选择:
然后点击 生成--》生成解决方案。。。等待编译结束。
编译好后设置:
1、包含文件路径:D:/wxWidgets-2.8.11/include
D:/wxWidgets-2.8.11/lib/vc_lib/mswd
2、库路径: D:/wxWidgets-2.8.11/lib/vc_lib
新建一个空项目(wx):
加入hello.h
#ifndef INCLUDED_HELLOWORLDAPP_H
#define INCLUDED_HELLOWORLDAPP_H
/**
* The HelloWorldApp class
* This class shows a window containing a statusbar with the text 'Hello World'
*/
class HelloWorldApp : public wxApp
{
public:
virtual bool OnInit();
private:
wxButton *button;
};
DECLARE_APP(HelloWorldApp)
#endif // INCLUDED_HELLOWORLDAPP_H
加入 hello.cpp 文件
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "hello.h"
#include
IMPLEMENT_APP(HelloWorldApp)
/* this is executed upon startup, like 'main()' in non-wxWidgets programs */
bool HelloWorldApp::OnInit()
{
wxFrame *frame = new wxFrame((wxFrame*) NULL, -1, _T("Hello wxWidgets World"));
frame->CreateStatusBar();
frame->SetStatusText(_T("Hello World"));
button = new wxButton((wxFrame *)frame, -2, _T("123"));
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
项目属性设置:
1、选择 unicode
2、预处理器定义 WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH
3 连接器输入
加入这些常用库的支持:其中含有‘ud’ 说明是 unicode debug , 我编译的是 debug 版的。
wxmsw28ud_core.lib
wxbase28ud_net.lib
wxbase28ud.lib
wxtiffd.lib
wxjpegd.lib
wxpngd.lib
wxzlibd.lib
wxregexud.lib
wxexpatd.lib
winmm.lib
comctl32.lib
rpcrt4.lib
wsock32.lib
odbc32.lib
编译项目:
生成-->生成解决方案。
运行效果如图:
有安装版和 压缩版的, 我这采用当时最新的 wxMSW-2.8.11
2、解压或者安装源文件包
假如路径是: D:/wxMSW-2.8.11
3、编译
用vs2008打开 D:/wxMSW-2.8.11/build/msw/wx.dsw
然后出现转换工程的界面,选择全部。
然后,配置编译的模式,如下选择:
然后点击 生成--》生成解决方案。。。等待编译结束。
编译好后设置:
1、包含文件路径:D:/wxWidgets-2.8.11/include
D:/wxWidgets-2.8.11/lib/vc_lib/mswd
2、库路径: D:/wxWidgets-2.8.11/lib/vc_lib
新建一个空项目(wx):
加入hello.h
#ifndef INCLUDED_HELLOWORLDAPP_H
#define INCLUDED_HELLOWORLDAPP_H
/**
* The HelloWorldApp class
* This class shows a window containing a statusbar with the text 'Hello World'
*/
class HelloWorldApp : public wxApp
{
public:
virtual bool OnInit();
private:
wxButton *button;
};
DECLARE_APP(HelloWorldApp)
#endif // INCLUDED_HELLOWORLDAPP_H
加入 hello.cpp 文件
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "hello.h"
#include
IMPLEMENT_APP(HelloWorldApp)
/* this is executed upon startup, like 'main()' in non-wxWidgets programs */
bool HelloWorldApp::OnInit()
{
wxFrame *frame = new wxFrame((wxFrame*) NULL, -1, _T("Hello wxWidgets World"));
frame->CreateStatusBar();
frame->SetStatusText(_T("Hello World"));
button = new wxButton((wxFrame *)frame, -2, _T("123"));
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
项目属性设置:
1、选择 unicode
2、预处理器定义 WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH
3 连接器输入
加入这些常用库的支持:其中含有‘ud’ 说明是 unicode debug , 我编译的是 debug 版的。
wxmsw28ud_core.lib
wxbase28ud_net.lib
wxbase28ud.lib
wxtiffd.lib
wxjpegd.lib
wxpngd.lib
wxzlibd.lib
wxregexud.lib
wxexpatd.lib
winmm.lib
comctl32.lib
rpcrt4.lib
wsock32.lib
odbc32.lib
编译项目:
生成-->生成解决方案。
运行效果如图:
相关文章推荐
- vs2008 配置 wxwidgets 环境
- vs2008下DShow开发环境配置
- VS2008中OpenGL环境配置
- VC6.0和VS2008环境下配置halcon开发环境
- Win7,64位,VS2008的64位编译环境的安装和配置
- DirectX一:在VS2008里面配置DirectX开发环境
- VS2008之WTL环境配置
- vs2008配置Directx 9.0开发环境
- .NET3.5和VS2008中的ASP.NET AJAX和VS 2005配置AJAX的环境
- VC6.0和VS2008的OpenGL环境配置
- C/C++代码静态检查工具Cppcheck在VS2008开发环境中的安装配置和使用
- VC6.0 VS2008 openGL环境配置 [和glut库的加入]
- [转]VS2008的DDK环境配置及DDK下载
- wxWidgets环境配置教程
- VS2008中openGL开发环境配置(目前最全版)
- ACE VS2008 环境配置
- vs2008 驱动开发环境配置
- vs2008下配置wxWidgets32&64位平台编译环境
- 在VS2008环境下配置DirectX目录
- VS2008 c++开发环境配置