1. obtain the latest QT creator and QT library on the official website.
Official Website: http://qt.nokia.com/
For example:
Qt creator binary for Windows (52 MB)
Http://get.qt.nokia.com/qtcreator/qt-creator-win-opensource-2.2.1.exe
Qt for Open Source C ++ development on Windows (319 MB)
Http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.3-mingw.exe
2. Install QT creator
Reference installation path: D: \ QT \ qtcreator-2.2.1
3. Install the QT Library
Refer to installation path: D: \ QT \ 4.7.3
The installation process prompts you to locate the mingw. You can view the mingw directory under the QT creator installation directory, that is:
D: \ QT \ qtcreator-2.2.1 \ mingw
4. QT creator Configuration
Method 1: manual Configuration
Start QT creator, select [tools] --> [Options] from the menu, click the [qt4] tab on the left, click [add] in the upper right corner, and then click [browse] at the bottom. browse to the path of qmake, where:
D: \ QT \ 4.7.3 \ bin \ qmake.exe
Finally, apply the setting. It is best to restart QT creator after the setting is complete.
? Method 2: Add environment variables (method 2 is problematic and awaiting verification)
D: \ QT \ 4.7.3 \ bin;
After environment variables are set, start QT creator. On the [qt4] tab above, you can view the QT versions detected from environment variables.
5. Create and run helloworld
NOTE: If compilation often encounters an error: jom.exe X. XX-empower you cores, you can try to cancel the "use Jom instead of nmake" option (this option is on the [project] tab under the menu [tools] --> [Options)
6. Run the executable file directly.
To directly double-click the executable files under the [debug] or [release] Directory of the project, add the following environment variables:
D: \ QT \ qtcreator-2.2.1 \ mingw \ bin; D: \ QT \ 4.7.3 \ bin;
? NOTE: If method 2 is selected in step 2, you only need to add D: \ QT \ qtcreator-2.2.1 \ mingw \ bin; (to be verified)
Or copy the following four files to the directory where the executable files are located.
D: \ QT \ qtcreator-2.2.1 \ mingw \ bin mingwm10.dll, libgcc_s_dw2-1.dll
D: qtcore4.dll and qtgui4.dll under \ QT \ 4.7.3 \ bin