C + + Gui QT4 Programming Learning Road (1)--QT Environment construction

Source: Internet
Author: User

Preface

Because the company needs to do a Linux under the development of QT, coupled with direct contact with some QT, then began to cramming.

Previously useful Qt wrote a 2048 game, about 3 April, that will be 2048 positive fire, think of oneself in the computer also did a ~ then silently wrote a, the interface is ugly, but perfectly formed ~ next time thinking and some code again induction, and then write to the blog.

Although writing a small thing, but the foundation is still very thin, so in order to let the foundation more consolidation, began to read C + + Gui QT4 Programming This book, this book is very good indeed.

QT Environment Building

First of all to build the QT environment, there are many versions available for download, I will download the latest QT 5.3.2 Open Source, but according to their own system version to download. 5.3.2 This SDK has integrated QT Creator, so there is no need for additional downloads, the earlier Qt4 seems to need to download QT Creator, the previous download of the discovery is not loaded, and then summed up the reason.

Since I'm using a 64-bit system for Windows 8, I chose

    • Qt 5.3.2 for Windows 64-bit (VS, 575 MB) (Info)

In addition to downloading the QT SDK, you also need to install VS2013, primarily for its compilers and debuggers. Previously installed QT Creator can not be built properly, the main problem is in the 64-bit system and compilers, the latter will slowly.

QT SDK After the completion of the QT Creator, the general project will be in this compilation environment Qmake, build, Debug, run.

Then open QT Creator Options--select Qt Versions

If you are using the link I provided above, it is generally possible to automatically detect the version information of the QT SDK, but if you do not detect it, you will need to find it manually.

Select Add, and then find the directory where the Qmake.exe is located, generally in the Qt bin directory, from see I have installed two qt,qmake path is generally in the bin directory.

Then you need to choose the compiler, this is very important, if the compiler chooses the wrong word often to build the time of the problem.

These compilers are automatically detected if you have selected the above suite and installed vs2013.

Previously downloaded QT is the window (MinGw) version, but it is 32-bit, and then found a variety of problems, the problem is generally in the building of the package will be gradually discovered.

Let's take a look at what's inside the build kit.

The first is automatic detection, you can see a yellow exclamation mark on the alarm ID, which means that the settings are not complete, but the other settings are normal, because I did not set the debugger, so there is alarm, when the debugger is set up will not have this alarm, debugging can use CDB, this can go to download, It seems that MinGW has a debugger with CDB.

Then the second is manually configured, in addition to the compiler this is different, the other configuration is the same, but in front of it is indeed a red error ID, which indicates that there is an error on the settings, specifically what error can move the mouse to the wrong ID.

Obviously, the hint is that this compiler cannot generate code for this version of the QT SDK, so obviously you can't use MinGW to act as a compiler for QT 5.3 MSVC2013 64bit, and of course, if the QT version is MinGW version, you naturally need to use the MinGW compiler. For example, this version.

    • Qt Libraries 4.8.6 for Windows (MinGW 4.8.2, 328 MB) (Info)

In general, the compiler is set up correctly, you can set up the correct QT creator compilation environment, but some times may be prompted missing some DLLs or something, this time need to configure the environment variable is good.

As for the environment variable How to configure, look at Baidu experience it.

The environment is ready to begin the official QT tour.

C + + Gui QT4 Programming Learning Road (1)--QT Environment construction

Related Article

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.