Install and configure Qt in Windows

Source: Internet
Author: User

First understand QT:

Qt has been divided into commercial and open-source versions. The commercial version provides users with a second-level dynamic library, which can be directly installed and used, but requires the cost to purchase the license, the open-source version complies with the GPL protocol and provides the source code. You must compile the source code to produce dynamic library files. Since Nokia abandoned meego and dismissed its QT Development Team, the commercial version of QT has moved its website to qt.digia.com, while open-source versions have moved to qt-project.org.

 

The following describes how to install the open-source version.

For QT development, you must first install QT library and QT creator

Qt Library provides the header file, static Link Library, and dynamic link library for the QT program;

Qt creator is an IDE for programming. It provides multiple functions such as GUI rendering, code writing, and program debugging.

 

Qt has multiple installation options in windows. Open the QT official download URL to know: http://qt-project.org/downloads

What needs to be declared here is that the various options I mentioned are not the version options, but the installation methods and compiler options ~

 

The download URL generally includes QT library and QT creator.

 

Qt Library

There are many versions. In Windows, you can choose mingw, vs2008, vs2010, and vs2012. The major difference between these versions is the compiler, because QT library can only be used after we compile it ourselves. Therefore, you need to decide what compiler is useful and then select the version. If you have installed vs, you can select the latter. If you have a special liking for Linux, you can choose mingw. I am a hobby, but my user experience is that mingw compilation is very slow, but it runs like.

This article selects the mingw version as an introduction .,

Qt creator

You can select any version without much difference. We recommend that you select the latest version to improve efficiency.

Install QT:

 

After you have selected QT library, make sure you have prepared enough before installation. If you want to find the mingw version, install mingw and then install QT library. During the installation process, you will be prompted to select the mingw installation directory. If the version is vs, you must use winsdk.

The following describes how to install mingw.

1. Install mingw:

: Http://mingwbuilds.sourceforge.net/put the decompressed file under the root directory of the C drive (other disks are fine, but remember to select a path when installing QT library ). Generally in C:/mingw

 

2. Install QT Library

Start to install QT library and follow the prompts to install it. Select the mingw installation project in the middle, and select the place you just installed, generally C:/mingw. The installation is complete.

Don't be happy too early. The real installation is just getting started. The download here is an open-source version, which is essentially the source code and some static libraries of the QT library. If you want to run it completely, you need to compile it, choose Start> program> QT by digia v4.8.5 (mingw opensource)> QT 4.8.5 (build debug libraries ). The command line window appears. Next, we need to compile the library.

Do not be afraid to see the command line. Generally, it won't let you set too much, but only two interactions. The first time is to let you choose open source 'O' or

For the commercial version 'C', click o on the keyboard. The second prompt is whether you agree to the terms. Click y on the keyboard. The next step is the long compilation process. Wait ......

 

3. Install QT creator

This is not set. All the way to next.

 

Use QT Library

After the installation is complete, if you want to use the qt sdk in QT creator, you still need to set it. Open the creator. In the menu bar, select the tool> plugin path (usually in bin \ gw.cmd.exe in the mingw directory), and select the qmake path and version number of QT (qmake is usually in QT \ 4.8.4 \ bin \ qmake.exe ).
Finally, select the "Kit" tab, click the "add" button to create a new compilation setting item, and select the compiler and debuger as prompted (usually in the bin \ gdb.exe in the mingw directory), QT version number, set, click application, and finally don't forget to set this new compilation option to defualt.

 

Good luck ---------------- Yaung

 

 

 

 

 

 

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.