Starting with the VC 6 qt 4.5.2 Tour

Source: Internet
Author: User

Starting with the VC 6 qt 4.5.2 Tour

Many online friends say QT 4.5 no longer supports the development of VC6, and at first scared me. I spent a week fiddling with Google and finally using VC6 to uncover the mysteries of Qt 4.5.2. Here are the specific steps I have summed up to share with you. Love the source of the cause of friends, I hope that my posts can indeed help you, but also please indicate the benefits of the source, for a lot!

First, the installation development environment:

1, WinXp (SP2) + VC 6 (SP5) + Qt-sdk-win-opensource-2009.03.exe

2, need to debug friends, please download Qt-win-opensource-src-4.5.2.zip decompression and cover to the QT SDK installation directory, run Cmd.exe type the following:

CD d:/qt200903 (installation directory for Qt SDK)

Configure.exe-debug-and-release

Nmake

Compiling the debug version of Qt takes about 1-2 hours, depending on your machine performance J.

I installed the Qt-sdk-win-opensource-2009.03.exe first, then unpacked the qt-win-opensource-src-4.5.2.zip and covered the QT SDK installation directory.

Of course, you can also choose to extract the qt-win-opensource-src-4.5.2.zip directly, without installing qt-sdk-win-opensource-2009.03.exe in step 1th, with a separate installation of QT Creator IDE 1.2 The way for Windows.

3, do not need to debug friends can skip step 2.

4. Note: The entire installation process does not require manual setting of any environment variables, nor does it require the installation of QT Visual Studio add-in, and much more.

5, the other here to recommend

A website: QT Chinese Forum

A good book: C + + Gui QT4 Programming (second edition), although there is no English original to see the fun, but translation is not bad.

Second, the configuration of VC 6 project:

1, VC6 a new WIN32 console application of the empty project:

Copy the generated. DSW and. dsp files to the directory of the QT Engineering source code, and open. DSW Engineering, in FileView, the QT Engineering directory of the source code. H/.CPP/.UI/.QRC files are added to the project and can be classified into emissions.

2. Ignore All default libraries:

Projectàsettings ... (ALT+F7) Engineering properties, Settings for:all configurations,link tab category:general in the hook select Ignore all default libraries

3. Set the Include directory in the project properties for the Include folder under the QT installation directory:

Settings For:all configurations,c/c++ tag category:preprocessor additional include Directories:d:/qt200903/include

Set the library directory in the project properties to the Lib folder under the QT installation directory:

Settings For:all configurations,link Tag category:input Additional library Path:d:/qt200903/lib

Also specify the static libraries you want to use:

Settings For:debug,link label Category:input object/library modules:QtCored4.lib QtGuid4.lib

Settings For:release,link label Category:input object/library modules:QtCore4.lib QtGui4.lib

4, selected project all. ui File Settings For:all configurations,general tab Always use custom build step,

Custom Build Label Commands:d:/qt200903/bin/uic.exe $ (inputname). Ui-o ui_$ (InputName). h (of which d:/qt200903/bin/ Uic.exe is the QT UI compiler UIC executable file under the bin subdirectory of the QT installation directory),

outputs:ui_$ (InputName). h

Once this setting is complete, the two. ui files are compiled separately, the Output window displays the success information, and the resulting two ui_$ (InputName). h files are checked in the corresponding directory:

5. Select all the. cpp files in the project Settings For:all configurations,general tab Always use custom build step,

Under Settings for:debug,custom build label Commands:

D:/qt200903/bin/qmake.exe-project

D:/qt200903/bin/qmake.exe

Nmake-f Makefile.debug

(where D:/qt200903/bin/qmake.exe is the QT Smart compiler qmake executable file under the bin subdirectory of the QT installation directory),

outputs:ui_$ (InputName). h


Settings for:release (similar to debug setting, note the Red Bold section below),

Custom build label under commands:

D:/qt200903/bin/qmake.exe-project

D:/qt200903/bin/qmake.exe

Nmake-f makefile. Release

(where D:/qt200903/bin/qmake.exe is the QT Smart compiler qmake executable file under the bin subdirectory of the QT installation directory),

outputs:ui_$ (InputName). h

6. Modify Engineering Properties:

The directory name of the current project in category:general output file name:debug/under the Settings for:debug,link tab. exe

The directory name of the current project in category:general output file name:release/under the Settings for:release,link tab. exe

The purpose is to make the executable for debug secssion in the category:general of the VC6 Debug tab consistent with the executable file name of the actual compilation output, to avoid the error in debugging or running that prompted the executable file to be found when the compilation is complete.

Finally, remember to add the debug version of the QtGuid4.dll, QtCored4.dll, or release version of QtCore4.dll, The referenced DLL, such as QtGui4.dll, is copied from the subdirectory bin of the QT installation directory to the corresponding debug or release working directory in the current engineering directory.

Wow, finally there is no console window and you can debug the QT 4.5 application. The whole process was hard, but it was very exciting.

Again thanks to Google can let me find a lot of previous clues, once again thanks to support the open source of all the companions, once again thank Trolltech, thanks again Nokia!

Finally I can start my QT 4.5 trip to the HoHo.

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.