MXE (M cross environment)
跨平台編譯環境
MXE Office Site
安裝步驟
步驟不要更改,不要下更新指令 不要下更新指令,更新會將src內套件版本,更新到套件Repo最新版本,會造成編譯錯誤
預先安裝所需套件
https://mxe.cc/#requirements
Clone MXE
開 Terminal,移動到要安裝 MXE 的資料夾
git clone https://github.com/mxe/mxe.git
cd mxe
安裝基礎套件
make cc
安裝 x86_64-w64-mingw32.static 套件
make MXE_TARGETS='x86_64-w64-mingw32.static'
安裝 i686-w64-mingw32.static 套件
make MXE_TARGETS='i686-w64-mingw32.static'
編譯
Autotools
./configure --host=i686-w64-mingw32.static
make
If you build a library, you might also want to enforce a static build:
./configure --host=i686-w64-mingw32.static --enable-static --disable-shared
make
CMake 專案
資料夾內虛有 CMakeLists.txt 才可使用cmake
- 有 export PATH
i686-w64-mingw32.static-cmake /%SOURCE_PATH%
make
- 無 export PATH
/Where MXE Installed/usr/bin/i686-w64-mingw32.static-cmake
make
QMake 專案
/home/zon/mxe/usr/i686-w64-mingw32.static/qt5/bin/qmake
make
編譯 QelectroTech
安裝 Qt5
make qt5
安裝額外 Qt 套件
將 附件 複製到 /Where MXE Installed/src
extra-cmake-modules
kcoreaddons
kwidgetsaddons
逐一安裝
make ecm
make kcoreaddons
make kwidgetsaddons
編譯 Qet for Windows
假設套件資料夾在home底下,qet-0.8
cd ~/qet-0.8
mkdir build
cd build
/Where MXE Install/usr/i686-w64-mingw32.static/qt5/bin/qmake ../qelectrotech.pro
make
完成後,執行檔在 ~/qet-0.8/build/release/qelectrotech.exe
編譯 Qet for Local Linux use
假設套件資料夾在home底下,qet-0.8
cd ~/qet-0.8
mkdir build
cd build
qmake ../qelectrotech.pro
make
完成後,執行檔在 ~/qet-0.8/build/qelectrotech