Qt entry notes-Windows
Favorites
I have been peat QT for a long time, but I have installed a Mac version on even Tom. I do not know the installation configuration in it, I have written several examples on MAC (I will add some precautions for Mac later ).
Install Windows XP as follows:
1. Download QT for open Souce C ++ development on Windows from trolltech official website at: ftp://ftp.trolltech.no/qt/source/qt-win-opensource-src-4.4.3.zip;
2. Decompress to the Directory D: \ QT \ qt-win-opensource-src-4.4.3;
3. Add environment variable qtdir = D: \ QT \ qt-win-opensource-src-4.4.3, set environment variable Path = % qtdir % \ bin; % PATH %;
4. Copy vsvars. bat under the VC installation directory to the qtdir directory and run it once;
4. Run cmd, enter the qtdir directory, and run the following command:
Configure-platform win32-msvc
Run nmake.
Configuration and compilation take a long time.
In vs2008, you can directly compile the QT program setting method:
1. Start vs2008 and create a makefile project named helloqt.
2. debug configuration parameter settings:
Build command line: qmake-Project & qmake & nmake debug
Clean commands: nmake debug-clean
Rebuild command line: qmake-Project & qmake & nmake debug
3. Release configuration parameter settings:
Build command line: qmake-Project & qmake & nmake release
Clean commands: nmake release-clean
Rebuild command line: qmake-Project & qmake & nmake release
4. Select properties under the project in the menu bar.
Set $ (targetpath) under command to $ (targetdir) \ debug \ $ (targetfilename ). Make sure that the correct path is executed during F5 debugging.
5. Add the QT Library Under vs2008 with the following settings:
6. Add a new project to the helloqt project, select the CPP class file, and name it main.
Write the main. CPP Code as follows:
- # Include <qapplication>
- # Include <qlabel>
-
- Int main (INT argc, char * argv [])
- {
- Qapplication app (argc, argv );
- Qlabel * label = new qlabel ("Hello QT! ");
- Label-> show ();
- Return app.exe C ();
- }
The full text is complete.
Http://blog.csdn.net/aaronkevin021/archive/2008/11/14/3298141.aspx