2. 閱讀源代碼文件夾中的README,了解編譯所需環境。
3. 設置環境變數及Path
添加環境變數_QTDIR 值為D:\
QtStaticLibraryCompilation\5.12.6
並在Path中添加路徑:
%_QTDIR%\qt-everywhere-src-5.12.6
%_QTDIR%\qt-everywhere-src-5.12.6\qtbase\bin
%_QTDIR%\qt-everywhere-src-5.12.6\gnuwin32\bin
%_QTDIR%\Tools\mingw\mingw730_64
4. 以管理員身份運行windows命令行。
「gcc -v」 檢查gcc版本及路徑(指定的工具包路徑)
「perl -v」 檢查perl版本
「python」 檢查python版本,Ctrl + z退出
「sh」 確保此命令不執行,以免影響ming32-make
5. 切換目錄 cd /d D:\
QtStaticLibraryCompilation\5.12.6\Build\qt_build_mingw730_64_static
配置:
D:\QtStaticLibraryCompilation\5.12.6\qt-everywhere-src-5.12.6\configure -static -debug-and-release -opensource -confirm-license -platform win32-g++ -sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype –compile-examples=no -nomake tests -nomake examples -skip qt3d -no-opengl -prefix D:\QtStaticLibraryCompilation\5.12.6\Library\mingw730_64_static
6. mingw32-make -j8 進行編譯,根據機器的情況,分配jobs數量。
7. mingw32-make install
8. 添加Qt Version,見「Qt Version添加」文檔。
原創文章,作者:投稿專員,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/255571.html