Install wxWidgets-3.0.2 on GNU/Linux Debian
转载自 http://www.binarytides.com/install-wxwidgets-ubuntu/
wxWidgets
wxWidgets is an application development framework/library that allows developer to make cross platform GUI applications for Windows, Mac and Linux using the same codebase.
In this tutorial I am going to show you how to compile and build wxwidgets 3.0+ on Debian based linux systems like Ubuntu and Linux Mint.
Compiling wxWidgets from source is not at all difficult as it might sound and takes only a few minutes to do.
The library can be compiled in different modes like static library or dynamic library.
1. Download wxWidgets
The first step would be to download the wxWidgets source files from wxwidgets.org
Once done, extract the files to a directory.
2. Setup build environment
To compile wxwidgets we would need some utility programs including the C++ compiler on Linux called g++. And all of it would be installed from the repositories using apt-get.
We also need the GTK development libraries which wxWidgets depend on.
$ sudo apt-get install libgtk-3-dev build-essential checkinstall
The utility called checkinstall would allow us to create an installation package for wxwidgets, so that later on it can un-installed easily using package managers
3. Compile wxWidgets
Get inside the directory where wxWidgets is extracted. In order to keep things clean, create a directory where the compilation would be done.
$ mkdir gtk-build
$ cd gtk-build/
Now run the configure and make commands one by one. Each one would take some time to finish.
$ ../configure --disable-shared --enable-unicode
$ make
The "--disable-shared" option instructs wxwidgets to builds static libraries instead of shared/dynamic ones.
After the make command finishes, the compilation is done successfully. Its time to install the wxWidgets files to the correct location.
More information about compile options can be found in install.txt and readme.txt files that can be found in /docs/gtk/ inside the wxwidgets directory.
4. Install with checkinstall
Now instead of using the "make install" command, we shall use the checkinstall command to create a deb package for wxwidgets. Run the following command
$ sudo checkinstall
Checkinstall would ask few questions during the process and make sure to provide a version number when asked, otherwise it would fail.
Once the process is over, wxWidgets would be installed and also a deb file would be created in the same directory.
5. Track the installed files
If you wish to check where the files are installed, use the dpkg command followed by the name of the package provided during the checkinstall process.
$ dpkg -L package_name
/.
/usr
/usr/local
/usr/local/lib
/usr/local/lib/libwx_baseu-3.0.a
/usr/local/lib/libwx_gtk3u_propgrid-3.0.a
/usr/local/lib/libwx_gtk3u_html-3.0.a
/usr/local/lib/libwxscintilla-3.0.a
/usr/local/lib/libwx_gtk3u_ribbon-3.0.a
/usr/local/lib/libwx_gtk3u_stc-3.0.a
/usr/local/lib/libwx_gtk3u_qa-3.0.a
/usr/local/lib/libwx_baseu_net-3.0.a
/usr/local/lib/libwxtiff-3.0.a
6. Compile the samples
After compiling wxWidgets, its time to compile the sample programs to see it in action. In the same directory where we compiled wxwidgets, a new subdirectory called samples would have been created.
Just enter it and run the make command
$ compile samples
$ cd samples/
$ make
After the make process finishes, get inside each sample sub directory and there should be an executable file that can be run right away to see the demo.
7. Compile your first program
After you are done with the demo programs, its time to write your own program and compile it. Again it is quite easy.
It is assumed that you are coding in C++ and for that you can use any good editor with syntax highlighting feature. For example gedit, kate, kwrite would do. Or you might want to try fully loaded IDEs like Geany, Codelite, Codeblocks etc.
However for your first program just use an ordinary text editor get it done quick.
Here it is
#include <wx/wx.h> class Simple : public wxFrame
{
public:
Simple(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150))
{
Centre();
}
}; class MyApp : public wxApp
{
public:
bool OnInit()
{
Simple *simple = new Simple(wxT("Simple"));
simple->Show(true);
return true;
}
}; wxIMPLEMENT_APP(MyApp);
Now save the program somewhere and compile it with the following commands
# compile
$ g++ basic.cpp `wx-config --cxxflags --libs std` -o program # run
$ ./program
Compiling with non standard libraries
The wx-config command shown above provides only the standard libraries by default. If you are using the Aui classes for example, then you need to specify additional libraries for it
$ g++ code.cpp `wx-config --cxxflags --libs std,aui` -o program
More information can be found here.
Resources
Download source and help files for wxWidgets
https://www.wxwidgets.org/downloads/
wxWidgets wiki page on compile instructions
https://wiki.wxwidgets.org/Compiling_and_getting_started
Notes on how to use the latest wxWidgets version (3.0+)
https://wiki.wxwidgets.org/Updating_to_the_Latest_Version_of_wxWidgets
Install wxWidgets-3.0.2 on GNU/Linux Debian的更多相关文章
- debian7 请把标有“Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 DVD Binary-1 20130615-23:06”的盘片插入驱动器“/media/cdrom/”再按回车键
		
有时候,在通过apt-get install 安装软件的时候,会出现: 更换介质:请把标有“Debian GNU/Linux 7.1.0 _Wheezy_ - Official amd64 DVD B ...
 - Debian系统中当安装deb软件时出现:deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 DVD Binary-1 20171209-12:11]/ stretch contrib main
		
vi /etc/apt/sources.list // 注释掉下面这句话# deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 D ...
 - (转)完全用GNU/Linux工作 by 王珢
		
完全用GNU/Linux工作 王珢 (看完这篇博文,非常喜欢王珢的这篇博客,也我坚定了学gnu/linux的决心,并努力去按照国外的计算机思维模式去学习编程提高自己.看完这篇文章令我热血沸腾 ...
 - Gnu/Linux的学习探索
		
1.Gnu/Linux是一个基于POSIX和UNIX的多用户多任务 支持多线程多CPU的类UNIX的操作系统. 继承了UNIX以网络为核心的设计思想 是性能稳定的多用户网络操作系统. 1991年10月 ...
 - 下一代GNU/Linux显示服务Wayland 1.12正式发布
		
导读 最近,Bryce Harrington很高兴地宣布了“面向GNU/Linux操作系统的Wayland 1.12.0显示服务已正式发布”的消息.与它一同到来的,还有Weston 1.12.0合成器 ...
 - ZFS(一):ZFS在Debian GNU/Linux上的安装
		
以下内容翻译自https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/,并附有原文,由于是第一次翻译,如有任何翻译不恰当之处,欢迎指出 ...
 - 完全用 GNU/Linux 工作(转)
		
转自:http://www.chinaunix.net/old_jh/4/16102.html 看到一半,实在太长,但已觉得很好,转来分享一下. 完全用 GNU/Linux 工作 - 摈弃 Windo ...
 - 在GNU/Linux下使用Lilypond排版简谱
		
尽管GNU/Linux并非无所不能,但确实能在很多时候提供免费.开放的解决方案.这两天我想做一个简谱,在网上搜索乐谱排版软件,发现了基于GPL协议的Lilypond软件.只不过Lilypond是用来做 ...
 - 我在GNU/Linux下使用的桌面环境工具组合
		
为了使GNU/Linux桌面环境下加载的程序较少以节省内存资源和提高启动时间,我目前并不使用重量级的桌面环境KDE和Gnome,甚至连登录窗界面gdm或xdm都不用,而是直接启动到控制台,登录后调用s ...
 
随机推荐
- Windows PowerShell ISE
			
Windows PowerShell 集成脚本环境 (ISE) 是 Windows PowerShell 的主机应用程序.在 Windows PowerShell ISE 中,可以在单一 Window ...
 - Spring Dynamic Modules   -  DMserver
			
spring dm server 官网:http://static.springsource.com/projects/dm-server/1.0.x/programmer-guide/htmlsin ...
 - 28335 sci fifo send
			
#include "DSP2833x_Device.h"#include "DSP2833x_Examples.h"char buf[]={0x30,0x32, ...
 - 转Oracle字符集问题总结
			
Oracle字符集问题总结 分类: Oracle2006-06-04 13:48 1298人阅读 评论(3) 收藏 举报 oracle数据库sqlcharacter存储insert 作者: vston ...
 - c++学习笔记之变量
			
变量的命名规则:标示符要能体现含义,变量的名字一般用小写,用户自己定义的类一般第一个字母大写,如果标示符有多个单词组成,则需要加下划线.' 变量声明和定义的关系:程序有多个文件组成,有时候需要再多个文 ...
 - 一个Option请求引发的深度解析
			
在当前项目中,前端通过POST方式访问后端的REST接口时,发现两条请求记录,一条请求的Request Method为Options,另一条请求的Reuest Method为Post.想要解决这个疑惑 ...
 - @synthesize 有什么好处?
			
如果不用 synthesize,操作的是 @property中定义的变量,使用synthesize之后,间接的操作了一个新的成员变量,到底有什么好处?直接只用一个@property不是更简单吗?
 - 容器适配器之queue
			
转载http://blog.csdn.net/thefutureisour/article/details/7751846容器适配器容器适配器其实就是一个接口转换装置,使得我们能用特定的方法去操作一些 ...
 - 格式化输出[part1/标准控制符]
			
/* 设置输出字符的宽度 width(int)是iostream类的成员函数,可以通过cout对象来调用,即cout.width(int) 注: 1.width(int)只影响将要显示的一个对象,之后 ...
 - Android -- 经验分享(二)
			
目录 自定义两个View进行画图,让 ...