• CodeBlocks16.01+wxWidgets3.0.2


    【环境】

    windows7 x64,CodeBlocks16.01,wxWidgets3.0.2

    【步骤】

    一、下载所需的文件:

    1、codeblocks官网:http://www.codeblocks.org  我下载的版本是codeblocks 16.01;

    2、wxWidgets官网:http://www.wxwidgets.org/,去页面https://github.com/wxWidgets/wxWidgets/releases/tag/v3.0.2下载已编译好的库和头文件。

    注:已编译好的库涵盖的lib更多,另如果自己编译release和debug两个版本编译得一个多小时,而且编译出来的lib还不全。

    共三个文件:

    wxMSW-3.0.2_gcc481TDM_ReleaseDLL.7z

    wxMSW-3.0.2_gcc481TDM_Dev.7z

    wxWidgets-3.0.2_headers.7z

    注:版本的选择,这里选择的32位。

    二、解压及安装

    1、安装codeblocks,安装后的目录:D:Program Files (x86)CodeBlocks-16.01

    2、新建wxWidgets目录,将以上三个文件解压至此目录。

    注:wxMSW-3.0.2_gcc481TDM_ReleaseDLL.7z和wxMSW-3.0.2_gcc481TDM_Dev.7z解压合并目录,改文件夹名gcc481TDM_dll为gcc_dll

    最终目录形式为:D:wxWidgetsinclude和D:wxWidgetslibgcc_dll。

    目录不要有中文及空格。

    三、codeblocks配置

    1、打开codeblocks;

    2、Settings->Global Variable

    3、Settings->Compiler->Linker Settings

    添加D:wxWidgetslibgcc_dll目录下所有的lib文件(.a文件)

    四、新建工程

    1、File->New->Project...

    选择wxWidgets project->Go

    2、

    3、

    注意选择对应的版本。

    4、

    项目的名称及路径

    5、

    也可不填,直接next

    6、

    7、

    选择wxWidgets的解压根目录

    8、

    9、

     

    在配置选项页中应该勾选”Use wxWidgets DLL"和"Enable unicode",

    不要勾选"wxWidgets is built as a monolithic library",

    原因是查找的lib文件夹不一样,前者查询gcc_dll,后者查询gcc_lib,会导致lib找不到。

    10、

    按需要选择相应的类库加到工程里,可暂时什么不选,后期手动添加也可。

    Finish

    11、

    得到工程,按F9编译运行,出错,如下图:

    具体Error文本信息如下:

    ||=== Build: Debug in wxWidgetsTestPro1 (compiler: GNU GCC Compiler) ===|
    
    D:Program Files (x86)CodeBlocks-16.01MinGWlibgccmingw324.9.2includec++itsc++0x_warning.h|32|error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.|
    D:wxWidgetsincludewxstrvararg.h|350|error: 'is_enum' in namespace 'std' does not name a template type|
    D:wxWidgetsincludewxstrvararg.h|354|error: 'is_enum' was not declared in this scope|
    D:wxWidgetsincludewxstrvararg.h|354|error: template argument 1 is invalid|
    
    ||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

    解决方法:

    项目,右键->Build Options->Compiler settings->Compiler Flags列表中,选择选择c++0x支持项,如下图

    再次编译运行,成功。

  • 相关阅读:
    springboot 整合jdbcTemplate
    springboot 整合springDataJPA
    springboot 全局异常处理
    springboot整合jsp模板
    springboot整合mybatis+pageHelper
    springboot整合mybatis
    springboot使用fastJson作为json解析框架
    springBoot开启热部署
    springboot快速入门
    解决springboot启动失败问题:Unable to start embedded container;
  • 原文地址:https://www.cnblogs.com/perfy/p/5457248.html
Copyright © 2020-2023  润新知