准備工作
在 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, 等等.
