vs2008 安装 wxwidgets 出现的问题

wxWidgets_xpm文件 XPM(X Pixmap)是X Windows系统使用的一种图片文件格式。最初由位于法国Sophia Antipolis的Bull研究中心的Daniel Dardailler和Colas Nahaboo发明,后来Arnaud Le Hors对其进行了改进。 XPM主要用于创建图 阅读详情

vs2008安装 wxwidgets         : error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用 

 

1,.菜单中选择 Project->Properties, 弹出Property Pages窗口
2,Configuration Properties->C/C++->Preprocessor,然后在右边栏的Preprocessor Definitions对应的项中删除_CONSOLE, 添加_WINDOWS.(如果有WIND32的话也要把WIND32删除,_如果有DEBUG可以不管它)
3,Configuration Properties->Linker->System,然后在右边栏的SubSystem对应的项改为Windows(/SUBSYSTEM:WINDOWS)

 

 

一、下载并解压缩wxWidgets
1. 到 http://www.wxwidgets.org/downloads 下载一个wxMSW版本的wxWidgets。(wxMSW是专门针对Windows系统)

  PS:这里推荐解压缩 版:http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.10.zip

2. 把下载的wxMSW-2.8.10.zip解压缩到C盘。(wxWidgets的安装路径最好不要出现空格和中文)

  例 如:C:/wxMSW-2.8.10

二、编译wxWidgets
1. 进入“C:/wxMSW-2.8.10/build/msw”目录。用VS2008打开wx.dsw,提示是否进行项目转换,点确定。

2. 编译Debug版本的库:右击《解决方案->配置管理器->活动解决方案配置 ->Unicode Debug》。然后右击《解决方案->生成解决方案》,等一会儿就可以编译出Debug版本的wxWidgets库了。

3. 编 译Relase版本的库:Release版本的wxWidgets库虽然也可以通过类似的方法去编译,但编译 出来的库仍然依赖于visual studio 2008的运行时库。Debug版本的库依赖VS2008也就算了,反正是自己调试用的。Release版本可是要给别人用的,再带上一大堆dll就不好 了。为了解决这个问题,我们需要先(解决方案->配置管理器->活动解决方案配置->Unicode Release),然后在解决方案资源管理器中,针对每一个项目右击《属性->配置属性->C/C++ ->代码生成->运行时库: 多线程(/MT)》(HOHO, 有20个项目要改属性啊~~~)。最后再右击《解决方案->生成解决方案》就可以了。

编译好后的wxWidgets会在 C:/wxMSW-2.8.10/lib/vc_lib目录下生成一系列的lib文件,这些lib文件的名字遵循下面的命 名规则:不依赖于GUI组件的库会以"wxbase"开头,紧跟着的是版本号,然后的字母表明这个库是否是编译为Unicode('u')或是否是编译为 Debug('d'),名字中的最后部分是wxWidgets组件的名字。
注意:wxWidgets编译完后在C:/wxMSW- 2.8.10/build/msw目录下会生成许多预编译头文件,占了很大的空间,如果确定以后不再编译 wxWidgets库的话,可以考虑删掉。

三、配置VS2008

  1. 打开工具 -> 选项 -> 项目和解决方案 -> VC++目录 -> 显示以下内容的目录
2. 在“包含文件”中加入“C:/wxMSW-2.8.10/include”和“C:/wxMSW-2.8.10/include/msvc”
3. 在“库文件” 中加入“C:/wxMSW-2.8.10/lib/vc_lib”

四、创建 wxWidgets项目

  新建一个空项目。然后设置项目的一些属性,可以选择下面的其中一 个来设置。譬如你如果打算使用Unicode,那么选择Unicode Debug或Unicode Release,如果你仅仅想调试程序而非发布,则只需要选择Debug设置。

Debug:
项目->属性 ->配置属性->常规 -> 字符集: 未设置
项目->属性->配置属性->C/C++ -> 代码生成 ->运行时库: 多线程调试(/MTd)
项目->属性->配置属性->链接器 -> 输入 -> 附加依赖项: wxbase28d.lib wxmsw28d_core.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib

Release:
项目->属性 ->配置属性->常规->字符集: 未设置
项目->属性->配置属性->C/C++ ->代码生成->运行时库: 多线程(/MT)
项目->属性->配置属性->链接器->输入-> 附加依赖项: wxbase28.lib wxmsw28_core.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib

Unicode Debug:
项目->属性 -> 配置属性 -> 常规 -> 字符集: 使用 Unicode 字符集
项目->属性 -> 配置属性 -> C/C++ -> 代码生成 ->运行时库: 多线程调试(/MTd)
项目->属性 -> 配置属性 -> 链接器 -> 输入 -> 附加依赖项: wxbase28ud.lib wxmsw28ud_core.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib

Unicode Release:
项目->属性 -> 配置属性 -> 常规 -> 字符集: 使用 Unicode 字符集
项目->属性 -> 配置属性 -> C/C++ -> 代码生成 ->运行时库: 多线程(/MT)
项 目->属性 -> 配置属性 -> 链接器 -> 输入 -> 附加依赖项: wxbase28u.lib wxmsw28u_core.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib oleacc.lib

这些静态链接库都是一 些可能会使用到的 Windows 系统的库,根据需要增减,比如我从来不用odbc,就不需要在这里添加 odbc32.lib。而 wxWidgets 的静态库会自动添加到工程中,不需要在这里设置,在 %WXPATH%/include/msvc/wx/setup.h 文件中可以看到加载这些库的代码。

编译成依赖 DLL 的执行文件还需要加上预处理指令 WXUSINGDLL
用 UNICODE 编译则需要加上预处理指令 _UNICODE
还有一种 Universal 编译,要加上预处理指令 __WXUNIVERSAL__
这样一个普通的 wxWdigets 项目就设置好了。

 

复制以下代 码添加到你的CPP文件中,进行编译,测试,OK!

代码
/////////////////////////////////////////////////////////////////////////// //
//  Name:        minimal.cpp
//  Purpose:     Minimal wxWidgets sample
//  Author:      Julian Smart
//  Modified by:
//  Created:     04/01/98
//  RCS-ID:      $Id: minimal.cpp 43915 2006-12-11 09:33:34Z CE $
//  Copyright:   (c) Julian Smart
//  Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////// //

//  ============================================================================
//  declarations
//  ============================================================================

//  ----------------------------------------------------------------------------
//  headers
//  ----------------------------------------------------------------------------

//  For compilers that support precompilation, includes "wx/wx.h".
#include  " wx/wxprec.h "

#ifdef __BORLANDC__
#pragma  hdrstop
#endif

//  for all others, include the necessary headers (this file is usually all you
//  need because it includes almost all "standard" wxWidgets headers)
#ifndef WX_PRECOMP
#include 
" wx/wx.h "
#endif

//  ----------------------------------------------------------------------------
//  resources
//  ----------------------------------------------------------------------------

//  the application icon (under Windows and OS/2 it is in resources and even
//  though we could still include the XPM here it would be unused)
#if  !defined(__WXMSW__) && !defined(__WXPM__)
#include 
" ../sample.xpm "
#endif

//  ----------------------------------------------------------------------------
//  private classes
//  ----------------------------------------------------------------------------

//  Define a new application type, each program should derive a class from wxApp
class  MyApp :  public  wxApp
{
public :
//  override base class virtuals
//  ----------------------------

//  this one is called on application startup and is a good place for the app
//  initialization (doing it here and not in the ctor allows to have an error
//  return: if OnInit() returns false, the application terminates)
     virtual   bool  OnInit();
};

//  Define a new frame type: this is going to be our main frame
class  MyFrame :  public  wxFrame
{
public :
//  ctor(s)
    MyFrame( const  wxString &  title);

//  event handlers (these functions should _not_ be virtual)
     void  OnQuit(wxCommandEvent &   event );
void  OnAbout(wxCommandEvent &   event );

private :
//  any class wishing to process wxWidgets events must use this macro
    DECLARE_EVENT_TABLE()
};

//  ----------------------------------------------------------------------------
//  constants
//  ----------------------------------------------------------------------------

//  IDs for the controls and the menu commands
enum
{
//  menu items
    Minimal_Quit  =  wxID_EXIT,

//  it is important for the id corresponding to the "About" command to have
//  this standard value as otherwise it won't be handled properly under Mac
//  (where it is special and put into the "Apple" menu)
    Minimal_About  =  wxID_ABOUT
};

//  ----------------------------------------------------------------------------
//  event tables and other macros for wxWidgets
//  ----------------------------------------------------------------------------

//  the event tables connect the wxWidgets events with the functions (event
//  handlers) which process them. It can be also done at run-time, but for the
//  simple menu events like this the static method is much simpler.
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(Minimal_Quit,  MyFrame::OnQuit)
EVT_MENU(Minimal_About, MyFrame::OnAbout)
END_EVENT_TABLE()

//  Create a new application object: this macro will allow wxWidgets to create
//  the application object during program execution (it's better than using a
//  static object for many reasons) and also implements the accessor function
//  wxGetApp() which will return the reference of the right type (i.e. MyApp and
//  not wxApp)
IMPLEMENT_APP(MyApp)

//  ============================================================================
//  implementation
//  ============================================================================

//  ----------------------------------------------------------------------------
//  the application class
//  ----------------------------------------------------------------------------

//  'Main program' equivalent: the program execution "starts" here
bool  MyApp::OnInit()
{
//  call the base class initialization method, currently it only parses a
//  few common command-line options but it could be do more in the future
     if  (  ! wxApp::OnInit() )
return   false ;

//  create the main application window
    MyFrame  * frame  =   new  MyFrame(_T( " Minimal wxWidgets App " ));

//  and show it (the frames, unlike simple controls, are not shown when
//  created initially)
    frame -> Show( true );

//  success: wxApp::OnRun() will be called which will enter the main message
//  loop and the application will run. If we returned false here, the
//  application would exit immediately.
     return   true ;
}

//  ----------------------------------------------------------------------------
//  main frame
//  ----------------------------------------------------------------------------

//  frame constructor
MyFrame::MyFrame( const  wxString &  title)
: wxFrame(NULL, wxID_ANY, title)
{
//  set the frame icon
    SetIcon(wxICON(sample));

#if  wxUSE_MENUS
//  create a menu bar
    wxMenu  * fileMenu  =   new  wxMenu;

//  the "About" item should be in the help menu
    wxMenu  * helpMenu  =   new  wxMenu;
helpMenu
-> Append(Minimal_About, _T( " &About.../tF1 " ), _T( " Show about dialog " ));

fileMenu
-> Append(Minimal_Quit, _T( " E&xit/tAlt-X " ), _T( " Quit this program " ));

//  now append the freshly created menu to the menu bar...
    wxMenuBar  * menuBar  =   new  wxMenuBar();
menuBar
-> Append(fileMenu, _T( " &File " ));
menuBar
-> Append(helpMenu, _T( " &Help " ));

//  ... and attach this menu bar to the frame
    SetMenuBar(menuBar);
#endif   //  wxUSE_MENUS

#if  wxUSE_STATUSBAR
//  create a status bar just for fun (by default with 1 pane only)
    CreateStatusBar( 2 );
SetStatusText(_T(
" Welcome to wxWidgets! " ));
#endif   //  wxUSE_STATUSBAR
}


//  event handlers

void  MyFrame::OnQuit(wxCommandEvent &  WXUNUSED( event ))
{
//  true is to force the frame to close
    Close( true );
}

void  MyFrame::OnAbout(wxCommandEvent &  WXUNUSED( event ))
{
wxMessageBox(wxString::Format(
_T(
" Welcome to %s!/n " )
_T(
" /n " )
_T(
" This is the minimal wxWidgets sample/n " )
_T(
" running under %s. " ),
wxVERSION_STRING,
wxGetOsDescription().c_str()
),
_T(
" About wxWidgets minimal sample " ),
wxOK 
|  wxICON_INFORMATION,
this );
}

 

 

错 误处理:
1. 在编译时出现了Cannot open include file: '../mswu/wx/setup.h': No such file or directory错误
这是因为项目属性的 Character Set设置不正确,必须与使用的wxWidgets库的Character Set一致。
2. 在编译时出现了MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBC.lib(free.obj)
这是因为没有连接正确的wxWidgets库,譬如Unicode Debug版本的项目就需要连接Unicode+Debug版本的wxWidgets库(库名后缀为'ud'的lib文件)。或者是wxWidgets和 Application使用的Runtime Library不相同。
3. 运行是出现No Debugging Information对话框
将Project Properties -> Linker -> Debugging -> Generate Debug Info的值改成Yes (/DEBUG)。

原文:http://www.cnblogs.com/princelive/archive/2010/04/12/1710437.html

PS:虽然2.90版本已经有了些许变化,但是影响不大,大体过程还是一样的,因此依样画葫芦即可。另外大家也不必手动的去添加lib到项目中,只需要包含头文件wx/Setup.h即可,该文件会自动的帮我们导入.lib,注意一点,静态库编译的lib文件和动态链接库的lib文件时不同的,如果你分别能找到对应的lib,但是又有链接错误,那么请检查链接到的lib是否是对应的lib,可以用宏WXUSINGDLL来让系统寻找DLL的Lib。

 

 

error LNK2005: _exit 已经在 LIBCMTD.lib(crt0dat.obj) 中定义
 设置工程属性:C/C++/代码生成/运行库 这一项的选项为多线程DLL (/MD),如还有错误,可以试选其

它几项。

Android开发实战:5分钟搞定全屏沉浸式状态栏(附完整代码示例) 本文提供了Android开发中实现全屏沉浸式状态栏的完整实战指南。通过对比主题配置、动态代码设置和Window标志位三种方法,详细讲解了如何隐藏状态栏并处理布局适配。文章还涵盖了刘海屏、手势导航等高级适配场景,并附有可直接使用的工具类代码,帮助开发者快速提升应用视觉体验。 阅读详情

相关推荐

驱动兼容_FANUC 驱动器兼容问题探讨

近10年来,FANUC伺服驱动器随着系统的升级而升级,不同的系统,可以兼容很多种类的驱动器,作者做了一些常见经验总结如下表:电源模块伺服放大器主轴放大器bi一体18i/OIB/OIC6110-Hxxx6114-Hxxx6111-Hxxx6134-Hxxx31iA/OID6140-Hxxx6117-Hxxx6141-Hxxx6164-Hxxx31IB/35IB/OIF/OI MATE D(5包)62...

weixin_34420941的博客 1758

Qt or vs2019release文件使用windeployqt打包显示缺少libgcc_s_seh-1.dll,手动添加后又报错应用程序无法正常启动(0xc000007b)

qt 打包exe qml

qq_35082781的博客 6110

i.MX RT1064引脚配置与BGA封装选型实战指南

在嵌入式硬件设计中,引脚配置与PCB布局是连接芯片手册与物理实现的关键桥梁,直接影响系统的稳定性与信号完整性。其核心原理在于理解处理器的IOMUX(输入/输出多路复用器)系统与多电源域架构,前者通过软件配置实现引脚功能的灵活复用,后者则为不同外设接口提供独立的电压基准,是保障电源稳定性的基石。从技术价值看,合理的引脚规划能规避信号干扰、电源不稳等潜在风险,提升设计一次成功率。在应用场景上,无论是连接SDRAM、USB、SDIO等高速外设,还是配置UART、I2C等中低速接口,都需要遵循特定的布局布线规则。本

weixin_33217202的博客 316

Windows下发布Qt应用程序,在另外的主机上运行异常

Windows Qt桌面程序发布问题

kuangjay66的博客 767

PADS VX2.4 缝合孔(阵列过孔)的添加方法

缝合孔的主要目的是:①:增加底层和顶层的地铜皮的连接性,②:起到屏蔽外界信号干扰的作用。铺完铜后,右击空区域选择“选择形状”命令,选取整板中的一块大铜皮,右击选择“覆铜区域内过孔阵列模式”→“沿周边”指令后,再右击选择“覆铜区域内过孔阵列”,便能看到已选区域内添加的缝合孔(过孔阵列),也可以通过铜皮显示或隐藏的无模命令:PO进行查看。完成上面的“防止错误”和“过孔样式”的设置后,开始对整板进行铺铜处理,点击“工具栏”→覆铜平面指示器,在弹出的对话框点击“开始”,便能观察铺铜后的板子。

tianpu2320959696的博客 3108

最新扣子(coze)案例:在coze上用DeepSeek+私有数据库、知识库,创建你的专属智能体

Gartner预测,到2026年,70%的企业将通过Al知识库实现「组织记忆外化」。数字化时代,数据已成为企业发展的核心资产。我们通过人工智能将知识库从“静态存储"升级为“智能服务”。让"沉睡宝藏"焕发新生,助力企业突破数据困局。

weixin_72689845的博客 2175

wxWidgets编译问题一例

前两天帮同事编译一个调用wxwidgets做的项目,用到了它的图形功能,从网上查资料,编译wxwidgets库时都要求做以下设置 C/C++ --> Code Generation --> Runtime Library 选 多线程调试(/MTd) 在编译项目主程序时总是出现“无法解析的外部符号 wxGraphicContext”或者“无法解析的外部符号 wxGraphicPath”之类的东东

TXH0001的专栏 1053

(实战)[re:Invent 2018]-001:赛道分析-(致敬1024)

打印log

Rainbow 2802

vs2008 配置 wxwidgets 环境

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     然后出现转换工程的界面,选择全部。     然后,配置编译的模式,如下选择: 然后点击 生成

吴亮与你共同进步 1468

告别手动处理:用 Bruker NSMatlabUtilities 工具箱批量分析 AFM 力曲线数据的实战案例

本文介绍了如何使用 Bruker NSMatlabUtilities 工具箱实现 AFM 力曲线数据的批量分析,解决传统手动处理耗时且易出错的问题。通过实战案例展示工具箱的核心功能,包括数据读取、力曲线分析和可视化,帮助科研人员提升数据处理效率和准确性。

weixin_28362173的博客 218

水文仿真软件:SWMM (Storm Water Management Model)_(6).地理信息系统(GIS)与SWMM数据交换

地理信息系统(GIS)与SWMM数据交换是水文仿真中的一个重要环节。通过合理的数据准备、导入、导出和校验,可以确保模型的准确性和实用性。本文介绍了使用SWMM GIS Add-on和Python脚本进行数据交换的方法,并提供了一些优化建议和常见问题的解决方案。希望这些内容能帮助读者更好地进行GIS与SWMM的数据交换,提高水文仿真的效率和质量。

kkchenjj的博客 587

vs2008 配置 wxWidgets

vs2008 配置 wxWidgets 1、 登陆http://www.wxwidgets.org/,下载wxMSW-2.9.2-Setup.exe 2、 运行wxMSW-2.9.2-Setup.exe,将wxWidgets安装到D:\wxWidgets-2.9.2 3、 安装完毕后还需要进行编译,要求有IDE,我用的是MS V...

weixin_30298497的博客 427

剪映专业版教程:用AI生成音乐MV并重新制作画面—《漂泊与归梦》完全原创实战

本文详细拆解如何用AI生成音乐MV并重新制作画面的全流程。以歌曲《漂泊与归梦》为例,首先用AI将歌词转化为带音乐的MP4文件;导入剪映后分离音频并删除原视频,通过“识别字幕”功能提取歌词文本并逐句核对修正;接着设置“向右擦除”动画并锁定字幕轨道;最后根据歌词意境配置动漫、风景等非真人画面规避审核风险。教程涵盖从AI生成、音频分离、字幕提取到画面重制的每个环节,助你打造完全原创、无侵权风险的音乐短视频。

深耕计算机专业知识与技术。 1095

vs2008+wxwidgets

一、下载并解压缩wxWidgets   1. 到 http://www.wxwidgets.org/downloads 下载一个wxMSW版本的wxWidgets。(wxMSW是专门针对Windows系统)   PS:这里推荐解压缩版:http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.12.zip   2. 把下载的

xuhaiyan8825的专栏 3005

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

vs2008下配置wxWidgets32&64位平台编译环境

vs2008下配置wxWidgets32&64位平台编译环境                 ---所使用的操作系统vista64bit---前言:wxWidgets是什么在此不作介绍,知道它支持跨平台开发,并且是开源软件即可。反正我在linux和win平台下都用过,虽然仅仅了解了一点皮毛。在win下,安装wxWidgets软件之后,还要用vc或.net等工具对其进行编译,再适当的配置,才可以在v

casablinca的专栏 2213

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

vs2008 安装 wxwidgets

Windows os下安装wxWindows的详细过程: 1、 登陆http://www.wxwidgets.org/,下载wxMSW-2.8.8-Setup.exe 2、 运行wxMSW-2.8.8-Setup.exe,将wxWidgets安装到D:/wxWidgets-2.8.8 3、 安装完毕后还需要进行编译,要求有IDE,我用的是MS Visual Studio 2008 4、 进入D:/wxWidgets-2.8.8/build/msw,运用MS Vis

jphaoren的专栏 961

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

wxwidget编译安装_wxWidgets的安装与编译 -《跟我学wxWidgets开发》系列教程

第二章wxWidgets的安装与编译要顺利使用wxWidgets进行开发,首页必须做好wxWidgets的安装和编译工作。由于本人只在Windows平台进行开发,所以本章只对基于Windows平台的安装和编译方法进行展开描述。2.1下载wxWidgets源码首先,我们需要在wxWidgets官网下载源码,作为开源项目,它的源码并没有直接存在官网,在官网Downloads栏目下它每个版本提供了两个下...

weixin_39615991的博客 2255

vs2008下配置WxWidgets

vs2008 配置 wxwidgets 环境 1 、去官网 http://www.wxwidgets.org/downloads 下载一个wxMSW版本的 wxWidgets 。 有安装版和 压缩版的, 我这采用当时最新的 wxMSW-2.8.11 2、解压或者安装源文件包       假如路径是: D:\wxMSW-2.8.11 3、编译

游戏爱好者1199 1088

wxwidgets 在win7 下Vs2008 的安装

wxwidgets 在win7 下Vs2008 的安装

ernest68028的专栏 259

发布一个VS2008下wxWidgets应用程序向导

由于每次创建wxWidgets工程都要手工添加依赖的lib和设定附加搜索目录,太麻烦了,然后自己鼓捣,弄成了一个向导。 以下是安装方法: 注意:此向导只保证x86下VS2008+wxWidgets-2.9.4下能正常工作       安装前请先定义环境变量wxWin,使其指向你的wxWidgets目录,例如:%wxWin%=D:\wxWidgets-2.9.4 假设VS2008安装

ccnyou的专栏 2027

用vs2008成功地编译WxWidgets-2.8.9

1. 用vs2008打开wx/build/msw/wx.dsw,开始转换格式,选是。2. 右击解决方案,选配置管理器。3. 在配置管理器中选择unicode release(以后写程序时都要配置   成unicode release)。4. 右击解决方案,选择批生成,选择每一个子项目的编译方式都   是unicode release,注意:这一步很重要,否则编译生成的   WxWidgets开发包

lxdsoft的专栏 2735

vs2008+wxWidgets3.0.0的配置完整版

一、下载安装wxWidgets 1.下载   地址为:“https://sourceforge.net/projects/wxwindows/files/3.0.0/wxMSW-Setup-3.0.0.exe” 2.安装   将下载好的“wxMSW-3.0.0-Setup.exe”安装到英文路径下,如“D:\wxWidgets-3.0.0” 二、编译wxWidgets

xtxm_hr的博客 770

wxWidgets资料总结

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.d

caowei880123的专栏 947

安装wxWidgets(vs2008)

Windows os下安装wxWindows的详细过程: 1、   登陆http://www.wxwidgets.org/,下载wxMSW-2.8.8-Setup.exe 2、   运行wxMSW-2.8.8-Setup.exe,将wxWidgets安装到D:\wxWidge

moyumoyu的专栏 1080

Visual Studio 2008 配合 WxWidgets

一、下载并解压缩wxWidgets   1. 到 http://www.wxwidgets.org/downloads 下载一个wxMSW版本的wxWidgets。(wxMSW是专门针对Windows系统)   PS:这里推荐解压缩版:http://prdownloads.s

moyumoyu的专栏 761
上一篇: vs2008 安装 wxwidgets
下一篇: lua的参考手册
jphaoren
博客等级 码龄20年 94粉丝 139原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值