Install Qt in Windows

Source: Internet
Author: User

Http://blog168.chinaunix.net/space.php? Uid = 25524263 & Do = Blog & id = 331859

A job on AVS needs to use QT on Windows. So try to install QT.

IDE uses QT creator. In Linux, this is the most common practice. Therefore, this is also used in windows.
I didn't understand it at first. I can refer to Baidu for the special features of QT in Windows compared to Linux/UNIX platforms. The following describes the installation method.

1: first install qt-creator-win-opensource-2.1.0. The installation directory can be selected by yourself (this part includes the compilation environment mingw) 2: Second install the qt-win-opensource-4.7.3-mingw. (This part includes the compilation software, qmake, and Library)
Note: Remember the mingw directory in step 1, such as: e: \ programming \ QT \ qtcreator-2.1.0 \ mingw will prompt to find the mingw directory when installing 2, then find the above directory.
After the installation is complete, set the environment variables. Steps are as follows: 1: Find the system environment variable after adding; E: \ programming \ QT \ qtcreator-2.1.0 \ mingw \ bin; E: \ programming \ QT \ 4.7.3 \ bin. Of course, the previous part depends on your own installation directory. 2: create two system variables in qmakespec = E: \ programming \ QT \ 4.7.3 \ mkspecs \ win32-g ++
The directory before qdir = E: \ programming \ QT \ 4.7.3 also depends on your own installation directory.

Then open QT and select demo.

Note:

The installation path must not contain Chinese characters.

Appendix: Installation of qt4.5.3 civilian strategy

Address: http://topic.csdn.net/u/20091106/14/998abad2-8e17-4bac-864b-482f94261359.html

First, install QT either in Linux (UBUNTU) or in windows.
Under Ubuntu: Enter
Sudo apt-Get install qt4-dev-tools
Sudo apt-Get install qtcreator
All done.
The first is to install the QT development kit, and the second is the Development Environment (optional, but strongly recommended)
Windows, just download the http://get.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2009.04.exe installation.

However, this is not the focus. What we want is: we are civilians, and we start from scratch.
Take the most widely used Windows as an example. In fact, Windows is the most complex.

First, download the compiler. Here I suggest you use mingw for free and the efficiency is good. With the support of qtcreator, do not use any c ++ IDE.
The version downloaded on the official website may be the corresponding GCC 3.4 port.
The current GCC has already been more than 4.4
The latest mingw packaged by a third party is TDM (not TMD)
You can Google the following TDM mingw
However, we downloaded the installation package, which is civilian and not installed. Therefore, the decompressed version is available here,

Http://download.csdn.net/source/1796126

After downloading, decompress the package to any location, but remember this location. For example, D: \ mingw441

Next we will download the source code of QT here: http://get.qt.nokia.com/qt/source/qt-win-opensource-src-4.5.3.zip
After the download, decompress the package to any location. But remember this location. For example, D: \ qt453

Then, set the system path. (This step is very important in Windows !)
In the window, right-click my computer and look for it. There should be a system variable button.
(I don't have windows here. Forgive me for writing it naked)

Add; D: \ mingw44 \ bin; D: \ qt453 \ bin to the PATH variable (two more bins are added)
Then open the command prompt (in the attachment)
Enter
D:
CD qt453
Configure-no-qt3support-fast
Select the open-source edition as prompted
Wait for a moment (qmake needs to be compiled here) about 5 minutes
Enter
Mingw32-make, compile the entire QT
It takes about 4 hours.
Enter
Mingw32-make clean
To clear useless intermediate files,
Download the source code of qtcreator.
Here http://get.qt.nokia.com/qtcreator/qt-creator-1.2.1-src.zip
It doesn't matter if you extract it to any location, such as D: \ qtcreator.
But then enter
D:
CD qtcreator
Qmake
Mingw32-make
About 10 minutes
There will be an additional qtcreator.exe file. If I remember correctly,
Click it bravely. It is not only your necessary development environment, but also the first QT program you compiled.
(Please correct me if there is anything wrong due to my naked writing)

Appendix:
The QT project file *. Pro is a platform-independent file.
Qmake is used to generate the makefile of the corresponding Platform Based on this pro.
The mingw32-make is calling this makefile for batch compilation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.