顯示具有 QT 標籤的文章。 顯示所有文章
顯示具有 QT 標籤的文章。 顯示所有文章

2023年8月1日 星期二

How to build the QT static version on the Windows platform?

1. Download the QT source code from the QT office website.

Download link: https://download.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz
NOTE: This example will use the version QT 5.15.2.

2. Unzip the source code to the local disk.

Example: "D:\qt-everywhere-src-5.15.2"

3. Install the depend tools and library.

The QT was depend some tools or library. By the QT 5.15.2, it was depend below list: 

Perl version 5.12 or later [http://www.activestate.com/activeperl/]

Python version 2.7 or later [http://www.activestate.com/activepython/]

Ruby version 1.9.3 or later [http://rubyinstaller.org/]

4. Open the VS2019 console.

NOTE: This example must need the VS2019 to build the QT source code. Please make sure your PC has installed the VS2019.

Launch the VS2016 console tool: "x64 Native Tools Command Prompt for VS 2019"

It will show some message like below:

 

 

 

5. Change the work folder to "D:\qt-everywhere-src-5.15.2".


$cd D:\qt-everywhere-src-5.15.2

6. Modify the source code: "qtbase\mkspecs\common\msvc-desktop.conf"

QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MD

QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MD

QMAKE_CFLAGS_DEBUG = -Zi -MDd

to

QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MT

QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -Zi -MT

QMAKE_CFLAGS_DEBUG = -Zi -MTd

7. Use the configuration tool to initialize QT code base.


$configure.bat -static -prefix "D:\Qt_static" -confirm-license -opensource -debug-and-release -platform win32-msvc -nomake examples -nomake tests  -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-pcre -qt-harfbuzz -opengl desktop -mp

NOTE: This example will set the final install path is "D:\Qt_static".

8. Download the build tool: "jom".

Download link: http://download.qt.io/official_releases/jom/jom.zip

This tool supports the multiple-core to build the source code on Windows Platform.

We assume your JOM unzip path is "D:/jom_1_1_3/jom.exe".

9. Build the QT source code.

NOTE: Please remember to change the work folder to the QT source code folder, like the "step 5".

Run the JOM in the console.

$D:/jom_1_1_3/jom.exe

10. Install the QT SDK to the local.


$nmake install

In the "step 7", we set the install path is "D:\Qt_static". After this command, it will help to install QT to this folder.

Reference: https://blog.csdn.net/zhangpeterx/article/details/105099003

2013年9月2日 星期一

QT4 - How to build the QT for arm ?

1. 安裝之後編譯需要的套件
#sudo apt-get install libxtst-dev

2. 取得 qt x11 server and qt embedded 並且編譯
#wget http://ftp.heanet.ie/mirrors/trolltech/pub/qt/source/qt-x11-opensource-src-4.5.3.tar.gz
#tar -zxvf qt-x11-opensource-src-4.5.3.tar.gz
#cd qt-x11-opensource-src-4.5.3/
#sudo ./configure
#sudo make;sudo make install

#cd tools/qvfb
#sudo make

#wget http://ftp.heanet.ie/mirrors/trolltech/pub/qt/source/qt-embedded-linux-opensource-src-4.5.3.tar.gz
#tar -zxvf qt-embedded-linux-opensource-src-4.5.3.tar.gz qt-embedded-linux-opensource-src-4.5.3/
#cd qt-embedded-linux-opensource-src-4.5.3/
#sudo ./configure -prefix /qt-library-4.5.3 -release -shared -fast -pch -no-qt3support -qt-sql-sqlite -no-libtiff -no-libmng -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -nomake tools -nomake examples -nomake demos -optimized-qmake -no-nis -no-opengl -no-cups -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-separate-debug-info -xplatform qws/linux-arm-g++ -embedded arm -depths 16 -confirm-license -little-endian
#sudo make;sudo make install
PS. /qt-library-4.5.3就是之後編譯安裝之後的目標 library 

3. 壓縮剛剛編譯完成的QT library
#cd /
#sudo tar -czvf qt-library-4.5.3.tar.gz /qt-library-4.5.3/
4. 接下就可以把製作完成的壓縮檔拿到開發版上面讓已經編譯完成的 QT 程式引用。

reference :
http://it1688.blog.hexun.com.tw/81109706_d.html
http://it1688.blog.hexun.com.tw/81109675_d.html