VS2015 Environment Building and QT compiler and debugger configuration

Source: Internet
Author: User
Brief Introduction

Prior to the introduction of the qt5.x environment, 5.7 began to support the VS2015, in order to use the new development environment (typical obsessive-compulsive disorder), have to re-Qt5.7 + VS2015 environment to build.

In addition to the details of the building described earlier, there are a lot of things to be aware of in the middle. Below, we mainly share the construction process and some of the matters needing attention.

Brief description Install VS2015 install Qt57 configure qt Creator configuration compiler Configuration Debugger Hello World VS2015 Configuration Install plug-in configuration qt Hello World More reference

Installing VS2015

Go to VS2015 official download page and download VS Community Edition-Visual Studio Community.

After the download is complete, install it directly, fool-next.

Note: When installing VS2015, remember to tick the "Visual C + +" option. Installing Qt5.7

Go to the official Qt download page, download Qt5.7, I downloaded: qt-opensource-windows-x86-msvc2015_64-5.7.1.exe.

After the download is complete, install it directly, fool-next.

Note: This is not complete at this point because not all of the resulting configurations are ready, so let's look at how to configure the compiler and debugger.

In order to be able to use both Qt Creator and VS2015, they must be configured in a series of different configurations. Configuring Qt Creator Configuring the compiler

If the compiler is not detected, in most cases it is because the "Visual C + +" option is not checked when installing VS2015.

Note: It is not OK to detect, do not unload load load (meet the problem on unloading load, restart the machine, can only say: Really powerful, Word elder brother. ), you only need to modify the next.

Go to Control Panel, programs and features, locate Microsoft Visual Studio Community Updates, and right-click to select Change.

Check the "Visual C + +" option, install again, fix it.

At this point, open Qt Creator, into the compiler section, you can see that QT has been automatically detected, do not need to manually configure.

As you can see, the warning symbols shown earlier in the build suite are automatically detected, and the debugger section shows "None", which indicates that the debugger has not been configured.

Configuring the Debugger

The debugger is not available by default and you must manually download the WinDbg.

During the installation process, you need to tick "debugging Tools for Windows".

After the installation is complete, open Qt Creator (if it is already open, please close and reopen). At this point, you can see that Qt has automatically detected the debugger, very simple.

Select the Automatically detected debugger in the build kit (KIT).

Hello World

Can't wait, just write a Hello world and debug it.

VS2015 Configuration Installing plugins

QT add-in can be used before VS2015, but in Visual Studio 2015, the QT plugin is not available, but it provides an extension (tools--Extensions and updates ...). ):

Select: Online, search for the keyword "Qt", the relevant plugin will appear:

You can see two very similar plugins:

QT Visual Studio Tools (2015): The creator is "the Qt company Ltd", and the screenshot in the lower right corner shows that this is the plugin we want.

Qtpackage: The creator is "Konstantin Stukov", and the screenshot in the lower right corner is similar to the above. This package can also be downloaded in qtpackage.

Choose which is good. When not clear, always be sure, choose the most trusted ... That must be the official Qt Visual Studio Tools (2015).

After installation, restart VS2015, and you will see the Qt VS Tools menu item on the menus bar:

Configuring Qt 5.7

Select: Qt VS Tools-qt options, configure QT 5.7. Click the "Add" button, Path select D:\Qt\Qt5.7.1\5.7\msvc2015_64, then click "OK" to save.

Note: If QT is not configured, "Unable to find a QT build!" will appear when you create a new QT project Error

Hello World

Configure the environment to quickly test it, write a small program, the most familiar Hello world.

Select: New project, File, and then select: QT-C-qt GUI application, templates

After entering the project name, click the "OK" button.

At this point, the corresponding code will be generated automatically, simply to compile, run. More References


QT Environment Building (Visual Studio) QT environment (QT Creator)

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.