zoukankan      html  css  js  c++  java
  • wxWidgets 在 Linux 下开发环境配置

    本文基于 CodeBlocks (16.0.1) 和 wxWidgets (3.0.2) 搭建 Linux 下 GUI 开发环境。

    1. 安装 CodeBlocks

      Ubuntu 默认的源当前 CodeBlocks 版本为 13.x,为安装最新稳定版,如下步骤,

      $ sudo add-apt-repository ppa:damien-moore/codeblocks-stable

      $ sudo apt-get update

      $ sudo apt-get codeblocks

    2. 下载 wxWidgets Linux 源码包 wxWidgets-3.0.2.tar.bz2

      - 解压到任意目录,比如 ~/wxWidgets-3.0.2   (安装完成后此包可以删除)

      - Linux 的安装说明在 ~/wxWidgets-3.0.2/docs/gtk/install.txt

      - $ ./configure --with-gtk --disable-shared --enable-unicode  # 编译成 SHARED=0, UNICODE=1, MONOLITHIC=0 (默认)

         输出信息如下,

       ==================================================================

        Configured wxWidgets 3.0.2 for `x86_64-unknown-linux-gnu'

        Which GUI toolkit should wxWidgets use?                        GTK+ 2 with support for GTK+ printing libnotify
        Should wxWidgets be compiled into single library?            no
        Should wxWidgets be linked as a shared library?              no
        Should wxWidgets support Unicode?                                 yes (using wchar_t)
        What level of wxWidgets compatibility should be enabled?
                                             wxWidgets 2.6      no
                                             wxWidgets 2.8      yes
        Which libraries should wxWidgets use?
                                             STL                    no
                                             jpeg                   sys
                                             png                    sys
                                             regex                builtin
                                             tiff                   sys
                                             zlib                   sys
                                             expat                sys
                                             libmspack          no
                                             sdl                    no

      ==================================================================

      - $ make

      - $ sudo make install

      - $ sudo ldconfig

      - $ wx-config --version   (应该输出 3.0.2,表示安装成功)

    3. 项目编译

      - 基于 CodeBlocks: 同 Windows 环境。

      - 基于命令行的编译 (注意 wx 相关信息如何添加,例如): $ g++ main.cpp simple.cpp `wx-config --cxxflags --libs` -o simple

      

    完。

  • 相关阅读:
    Lua脚本语法说明(修订)
    C++ 程序文档生成器介绍(doxygen)
    [转]最快速度找到内存泄漏
    MyEclipse 8.5下安装tomcat插件
    Linux解压rar文件(unrar安装和使用,分卷解压)
    禁止root用户远程登录或者禁止其他用户登录而不删除它
    linux配置IP的方法
    log4j xml配置详解
    Sqlldr使用介绍
    Linux查看CPU和内存使用情况
  • 原文地址:https://www.cnblogs.com/gaowengang/p/5823888.html
Copyright © 2011-2022 走看看