How to Install Qt SDK on Microsoft Windows
Method 1 of 6:
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. Preparing your Windows operating system for Qt application development
- 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.
Method 2 of 6:
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
Method 3 of 6:
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
- Add the following to the Windows system PATH
- 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
- While in the QtHelloWorld directory, use a text editor such as Notepad or Wordpad to create your Qt source code type the following
- 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
- Create the application in the notepad or wordpad text editor, enter the following below
- Type/Copy/Paste:
#include #include #include #int main(int argc, char *argv[ ]) { QApplication app(argc, argv); QLabel hello("Welcome to my first WikiHow Qt program"); hello.setWindowTitle("My First WikiHow Qt Program on Windows"); hello.resize(400, 400); hello.show(); return app.exec(); }
- Save the source code file as main.cpp
- While in the QtHelloWorld directory run the following to compile and link the Qt source code
- Type/Copy/Paste: qmake -project
- this will create the Qt project file
- Type/Copy/Paste: qmake
- this will prepare the Qt project file to be compiled
- Type/Copy/Paste: make
- this will compile the Qt source code into an executable program
- Once the above tasks have been successfully performed and there are no errors The Qt application will be created in the QtHelloWorld debug folder as an executable ending in .exe Change into the debug folder and execute the Qt application by either clicking the application or running the Qt application from the command line.
- Type/Copy/Paste: cd debug
- change into the debug folder
- Type/Copy/Paste: QtHelloWorld.exe
- and run the newly created executable
- Congratulations you just compiled your Qt application from the command line on Windows.
Method 4 of 6:
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. Preparing your Windows operating system for Qt application development
- 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.
Method 5 of 6:
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
Method 6 of 6:
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
- Add the following to the Windows 8 System PATH
- 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
- While in the QtHelloWorld directory, use a text editor such as Notepad or Wordpad to create your Qt source code type the following
- 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
- Create the application in the notepad or wordpad text editor, enter the following below
- Type/Copy/Paste:
#include #include #include #int main(int argc, char *argv[ ]) { QApplication app(argc, argv); QLabel hello("Welcome to my first WikiHow Qt program"); hello.setWindowTitle("My First WikiHow Qt Program on Windows"); hello.resize(400, 400); hello.show(); return app.exec(); }
- Save the source code file as main.cpp
- While in the QtHelloWorld directory run the following to compile and link the Qt source code
- Type/Copy/Paste: qmake -project
- this will create the Qt project file
- However, in Qt 5.0 SDK you must use a text editor and add the following to your generated *.pro file, use a text editor such as nano or gedit and issue the following commands:
- Type/Copy/Paste: notepad QtHelloWorld.pro
- Your generated QtHelloWorld.pro should look similar to this:
TEMPLATE = app TARGET = QtHelloWorld #INCLUDEPATH += . # Input SOURCES += main.cpp
- Edit your generated QtHelloWorld.pro file to look like this:
TEMPLATE = app TARGET = QtHelloWorld QT += core gui QT += widgets #INCLUDEPATH += . # Input SOURCES += main.cpp
- Once you add the following lines to the QtHelloWorld.pro file under the TARGET keyword, then run qmake
- Type/Copy/Paste: QT += core gui
- Type/Copy/Paste: QT += widgets
- Save the file and exit
- Type/Copy/Paste: qmake
- This will create the Qt make file
- Type/Copy/Paste: make
- This will compile the Qt make file on your system into an executable program. At this point, providing that there are no errors the file should compile into an executable program.
- Once the above tasks have been successfully performed and there are no errors The Qt application will be created in the QtHelloWorld debug folder as an executable ending in .exe Change into the debug folder and execute the Qt application by either clicking the application or running the Qt application from the command line.
- Type/Copy/Paste: cd release
- change into the release folder
- Type/Copy/Paste: QtHelloWorld.exe
- and run the newly created executable
- Congratulations you just compiled your Qt application from the command line on Windows.
4.5 ★ | 2 Vote
You should read it
May be interested
- How to Install Windows 10 on a Macthis wikihow teaches you how to install windows 10 on your mac using boot camp. before you can install windows 10 on your mac, you must first download the windows 10 installation file from microsoft's website. ensure that your mac meets...
- How to install Microsoft NET Framework 4.5 full for Windows 7, 8 with Windows Updatein the article below, tipsmake.com will guide you on the necessary steps to install net framework 4.5 on windows 7 platform. technically, there are many ways to install the .net framework platform on the operating system. windows such as downloading offline files, installing via windows features ...
- How to install Windows 8.1 from USBin addition to installing windows 8.1 from a traditional dvd, we can install windows 8.1 from a usb flash drive with a simple and fast way to do it.
- Microsoft will allow Windows 11 to be installed on computers with old CPUscomputers with old cpus will no longer be blocked from installing windows 11. microsoft has just announced that it won't block users from installing windows 11 on older computers.
- How to install Windows 10 from USB with ISO fileinstalling win 10 from usb requires usb boot or iso file windows 10. installing windows 10 with usb is not too difficult if you follow the instructions to install win 10 details below of tipsmake.com.
- Fix Microsoft Store not downloading apps and gamesmicrosoft store is where you can install apps and games on your windows pc. but sometimes for various reasons, you cannot download it from microsoft store.
- Microsoft facilitates users to install Windows 10 S versionat the end of spring this year, microsoft launched windows 10 s operating system with the new product line, surface pro and surface laptop. currently, microsoft is supporting users to use this operating system for free. read the article for more details and how to download win 10 s!
- How to bypass TPM 2.0 requirement to install Windows 11microsoft has confused many users by stipulating that any machine that wants to officially upgrade to windows 11 will need to support tpm 2.0, citing security reasons.
- Install Windows 10 with a super fast USB in just a few simple stepsthere are many ways to install windows 10 on your computer. in this article, techz will guide you how to install windows 10 with usb quickly and easily.
- How to download and install Windows 11 ARM with ISO filewindows 10 arm-based pcs have many limitations. with the release of windows 11 arm, microsoft has improved the situation somewhat because now there is support for 64-bit applications, as well as many other improvements.