[Qt] MXE - M cross environment

MXE是一套cross complier,可以讓寫好的Qt程式,在Linux環境下編譯成Windows可執行的程式。以下簡單紀錄MXE的基本編譯和使用方法。




MXE (M cross environment)

編譯:
1. 先到官網下載檔案http://mxe.cc/#download
git clone -b stable https://github.com/mxe/mxe.git

2. 參考官方的tutorial
http://mxe.cc/#tutorial

3. 編譯qt5, 預設是i686-pc-mingw32版本
make -j4 qt5

編譯時,會出現提醒需安裝的套件,這時再用apt-get install安裝套件即可。

4. 加入環境變數 ~/.bashrc
export PATH=/where MXE is installed/usr/bin:$PATH

使用:
用法很簡單,只要到寫好的qt專案中,用終端機執行以下2個command指令
/where MXE is installed/usr/i686-pc-mingw32/qt/bin/qmake
make

make執行完後,資料夾會出現release資料夾,同時可看到.exe執行檔,
將release整個帶到windows下就能執行了。

留言

  1. Borgata Hotel Casino & Spa Launches Live Race & Sports
    Borgata Hotel Casino & Spa is excited to announce that it has 성남 출장마사지 partnered 과천 출장안마 with the Gila River 계룡 출장샵 Indian 남양주 출장안마 Community to 군산 출장마사지 create a dedicated and engaging racing

    回覆刪除

張貼留言

這個網誌中的熱門文章

[Ubuntu] 幫 Ubuntu 更換 Kernel

[Ubuntu] ModelSim Linux 安裝