准备工作
在 https://www.wxwidgets.org/downloads/ 下载最新的稳定版 wxWidgets-3.0.4.tar.bz2
安装依赖
sudo apt install libgtk-3-dev build-essential checkinstall
编译安装
$ make # ... 略 ... $ sudo checkinstall
checkinstall会需要准备好package的描述等, 详细的输入输出. 使用checkinstall会同时生成deb包, 以及安装明细, 将来如何移除的提示
$ sudo checkinstall checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran This software is released under the GNU GPL. The package documentation directory ./doc-pak does not exist. Should I create a default set of package docs? [y]: Preparing package documentation...OK Please write a description for the package. End your description with an empty line or EOF. >> wxWidgets library 3.0.4 >> ***************************************** **** Debian package creation selected *** ***************************************** *** Warning: The package name "wxWidgets" contains upper case *** Warning: letters. dpkg might not like that so I changed *** Warning: them to lower case. This package will be built according to these values: 0 - Maintainer: [ root@milton-x240 ] 1 - Summary: [ wxWidgets library 3.0.4 ] 2 - Name: [ wxwidgets ] 3 - Version: [ 3.0.4 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ wxWidgets-3.0.4 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ wxwidgets ] 12 - Conflicts: [ ] 13 - Replaces: [ ] Enter a number to change any of them or press ENTER to continue: [Enter] Installing with make install... # ... 略 ... Copying files to the temporary directory...OK Stripping ELF binaries and libraries...OK Compressing man pages...OK Building file list...OK Building Debian package...OK Installing Debian package...OK Erasing temporary files...OK Deleting temp dir...OK ********************************************************************** Done. The new package has been installed and saved to /home/milton/Backup/linux/wxWidgets-3.0.4/wxwidgets_3.0.4-1_amd64.deb You can remove it from your system anytime using: dpkg -r wxwidgets **********************************************************************
检查安装路径
$ dpkg -L wxWidgets
这次安装并未按某些网页教程提示的增加 /etc/ld.so.conf.d/ 配置文件并执行sudo ldconfig, 但是可以i正常编译, 所以ldconfig这步应该是不需要了.
编译Samples样例
wxWidgets源码已经带了一个samples的样例包, 在安装完成后就可以直接编译测试
$ cd samples/ $ make
编译成功后, 里面的子目录会带着编译好的可执行程序, 例如 popup, tarskbar, text, treelist, 等等.