How to Install Qt SDK on Microsoft Windows

The Qt software development kit (SDK)] is a cross-platform framework used for developing graphical user interfaces. We'll show you how to download, install, and run the QT SDK on a Windows PC, and how to add it to your system path in Windows 7 and 8.

Qt 4.8 SDK Installation Instructions:

In order to setup the development environment for the Qt SDK we will have to obtain the Qt SDK.

  • Download the Qt SDK. Select the Windows version and be prepared for a long download depending on your Internet speed. I would suggest you select the off-line installation of the Qt SDK if you do not have a very fast internet connection. The complete Qt SDK for the Windows operating system is 1.7 GB which can take over 6 hours on a slow connection.

Install the Qt SDK by clicking on the Qt SDK executable.

Once the Qt SDK executable is installed you will need to edit the Windows system PATH so that the Windows operating system can find the Qt commands from the command line. Be careful editing your Windows system PATH.

Edit the Windows Vista/Windows 7 PATH:

Follow the steps below.

  • Click on the Start Button
  • Click on Control Panel
  • Click on System and Maintenance
  • Click on System
  • Click on Advanced System Setting
  • Click on Environmental Variables
  • Click on PATH to edit system wide variables
  • Click OK when finished

Edit the Windows 8 PATH:

Follow the steps below.

  • Click on the Folder icon located on the bottom task bar next to the Internet Explorer icon
  • Scroll down to Computer
  • Right click with your mouse on Properties
  • Click on Advanced System Setting
  • Click on Environmental Variables
  • Click on PATH to edit system wide variables
  • Click OK when finished

WH.shared.addScrollLoadItem(’84f0ec1a019cdf9e09c33662c2df5216′)

  • Type/Copy/Paste: ;C:QtSDKmingwbin;C:QtSDKDesktopQt4.8.1mingwbin;
  • this will set and notify the Windows operating system to compile Qt SDK applications from the command line. The numbers 4.8.1 denote the version number of the Qt SDK which changes with each new upgrade of the Qt SDK, substitute the new version numbers for your Qt SDK version number.

Important:

You want to use the version of MinGW included with the Qt SDK in order to build your Qt applications.If another version of the MinGW compiler is installed on the Windows system PATH such as ;C://MinGW/bin you will have to remove it and add the Qt version of MinGW which is included in the Qt SDK. This is critical if you have another version of the MinGW C/C++ compiler installed on your Windows system you must remove the other MinGW from the Windows system PATH, because this will cause conflicts with the Qt version of MinGW and your Qt applications will not compile and build correctly from the command line properly. Essentially, if you use another version of the MinGW C/C++ compiler your Qt applications you create from the command line will crash and exit with multiple system error messages. You must use the version of MinGW C/C++ compiler included with the Qt SDK.

Once the Qt SDK system PATH has been added to the Windows operating system.

To check if you have the ability to compile from the Windows command line, open up a command line prompt and issue the following command below.

Type/Copy/Paste:

qmake -version

  • You should receive a response similar to this:
  • ‘QMake version 2.01a
  • ‘Using Qt version 4.8.1 in C:QtSDKDesktopQt4.8.1mingwlib

Develop your applications from the command line by using a text editor such as Notepad or WordPad to create and edit the source code and compile your Qt applications from the command line.

Once the Qt SDK is added to the system PATH using the instructions above you can now compile your applications from the command line using the following method by running the following commands.

Open up a command line prompt and enter the following commands below.

  • Type/Copy/Paste: mkdir Qt-Applications
  • Type/Copy/Paste: cd Qt-Applications
  • Type/Copy/Paste: mkdir QtHelloWorld
  • Type/Copy/Paste: cd QtHelloWorld

WH.shared.addScrollLoadItem(‘7731f75727c3e375d631bf3abcae4ef4’)

  • Type/Copy/Paste: notepad main.cpp
  • make sure you save the Qt source code file as main.cpp
  • or
  • Type/Copy/Paste: start wordpad
  • using Wordpad as a text editor you will manually have to save the Qt source code file as main.cpp

WH.shared.addScrollLoadItem(‘c66079780692cdb4376df93b1bcd1b8b’)

  • Type/Copy/Paste:

Qt 5.0 SDK Installation Instructions:

In order to setup the development environment for the Qt SDK we will have to obtain the Qt SDK.

Download the Qt SDK. Select the Windows version and be prepared for a long download depending on your Internet speed. I would suggest you select the off-line installation of the Qt SDK if you do not have a very fast internet connection. The complete Qt SDK for the Windows operating system is 1.7 GB which can take over 6 hours on a slow connection.

Install the Qt SDK by clicking on the Qt SDK executable.

Once the Qt SDK executable is installed you will need to edit the Windows system PATH so that the Windows operating system can find the Qt commands from the command line. Be careful editing your Windows system PATH.

Edit the Windows Vista/Windows 7 PATH:

Follow the steps below.

  • Click on the Start Button
  • Click on Control Panel
  • Click on System and Maintenance
  • Click on System
  • Click on Advanced System Setting
  • Click on Environmental Variables
  • Click on PATH to edit system wide variables
  • Click OK when finished

Edit the Windows 8 PATH:

Follow the steps below.

  • Click on the Folder icon located on the bottom task bar next to the Internet Explorer icon
  • Scroll down to Computer
  • Right click with your mouse on Properties
  • Click on Advanced System Setting
  • Click on Environmental Variables
  • Click on PATH to edit system wide variables
  • Click OK when finished

WH.shared.addScrollLoadItem(‘469a1976753ba90e6b8be73291c99215’)

  • Type/Copy/Paste:;C:QtQt5.0.25.0.2mingw47_32bin;C:QtQt5.0.2ToolsMinGWbin;
  • this will set and notify the Windows operating system to compile Qt SDK applications from the command line. The numbers 5.0.2 denote the version number of the Qt SDK which changes with each new upgrade of the Qt SDK, substitute the new version numbers for your Qt SDK version number.

Important:

You want to use the version of MinGW included with the Qt SDK in order to build your Qt applications.If another version of the MinGW compiler is installed on the Windows system PATH such as ;C://MinGW/bin you will have to remove it and add the Qt version of MinGW which is included in the Qt SDK. This is critical if you have another version of the MinGW C/C++ compiler installed on your Windows system you must remove the other MinGW from the Windows system PATH, because this will cause conflicts with the Qt version of MinGW and your Qt applications will not compile and build correctly from the command line properly. Essentially, if you use another version of the MinGW C/C++ compiler your Qt applications you create from the command line will crash and exit with multiple system error messages. You must use the version of MinGW C/C++ compiler included with the Qt SDK.

Once the Qt SDK system PATH has been added to the Windows operating system.

To check if you have the ability to compile from the Windows command line, open up a command line prompt and issue the following command below.

Type/Copy/Paste:

qmake -version

  • You should receive a response similar to this:
  • ‘QMake version 3.0
  • ‘Using Qt version 5.0.2 in C:QtQt5.0.2mingwlib

Develop your applications from the command line by using a text editor such as Notepad or WordPad to create and edit the source code and compile your Qt applications from the command line.

Once the Qt SDK is added to the system PATH using the instructions above you can now compile your applications from the command line using the following method by running the following commands.

Open up a command line prompt and enter the following commands below.

  • Type/Copy/Paste: mkdir Qt-Applications
  • Type/Copy/Paste: cd Qt-Applications
  • Type/Copy/Paste: mkdir QtHelloWorld
  • Type/Copy/Paste: cd QtHelloWorld

WH.shared.addScrollLoadItem(‘2c81a9fbe4d67d725f35be8afa2ac993’)

  • Type/Copy/Paste: notepad main.cpp
  • make sure you save the Qt source code file as main.cpp
  • or
  • Type/Copy/Paste: start wordpad
  • using Wordpad as a text editor you will manually have to save the Qt source code file as main.cpp

WH.shared.addScrollLoadItem(’42d58afe30804c0df79bc90cad16afb5′)

  • Type/Copy/Paste:

Leave a Comment