# Build wxWidgets-3.1.3 on CentOS 7 ## 建立wxWidgets lib 1. 安裝**GTK3** `sudo yum -y install gtk3-devel` 2. 下載**wxWidgets source code** 1. 從++GitHub++取得 `https://github.com/wxWidgets/wxWidgets` 2. 從++官網++取得 `https://www.wxwidgets.org/` 3. 在**wxWidgets source code directory**中,建立一個++資料夾++供建置使用 `mkdir cent_OS_7_build` `ex: wxWidgets-3.1.3/Cent_OS_7_build` 4. 移動至剛剛建立的資料夾中 `cd cent_OS_7_build` 5. 設定**wxWidgets config** `../configure --with-gtk=3 --disable-shared --enable-unicode` *`Noticed:`*` 設定依需求更動` 6. 編譯**wxWidgets** `make` `編譯出的lib會在 wxWidgets-3.1.3/Cent_OS_7_build/lib/ ## 編譯並執行sample 1. 進入**samples**資料夾 `cd wxWidgets-3.1.3/Cent_OS_7_build/samples/ 2. 編譯**minimal** `cd minimal/` `make` 3. 執行**minimal** ./minimal` ## 簡單的Makefile示例 ```makefile= WXCONFIG=/home/user/wxWidgets_3_1_3/Cent_OS_7_build/ all: g++ -std=c++11 main.cpp `$(WXCONFIG)wx-config --cxxflags --libs` -O2 clean: rm *.o *.out ``` ###### tags: `wxWidgets` `CentOS`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up