Build the QT development environment under vs2008

Source: Internet
Author: User

Local Environment: win7 SP1; 64-bit operating system;

To prepare for installation, download the following files:

1. vs2008
Http://www.jb51.net/softs/73040.html

2.qt-vs-addin-1.1.11.exe
Http://www.qtcn.org/bbs/read-htm-tid-1075.html

3.qt-win-opensource-4.8.0-vs2008.exe

Http://download.qt-project.org/archive/qt/4.8/4.8.0/


Installation steps:

1. Install vs2008

2.install qt-win-opensource-4.8.0-vs2008.exe (for example, D: \ QT \ 4.8.0)

3.install qt-vs-addin-1.1.11.exe (you can select any path)

4. configure QT environment variables, Control Panel> system and security> system> advanced system Settings> environment variables. In the "System variables" dialog box, locate the "path" variable, add "D: \ QT \ 4.8.0 \ bin \" at the end of "path \"

5. Go to the vs installation path \ Vc \ bin under CMD and run vcvars32. Then, vcvas32.bat is executed to automatically set environment variables for.

[Note] If this option is not executed, the nmake: Fatal error u1077. return code 0x2 error may occur.

6. Modify row 327th of the QT installation path: D: \ QT \ qt4.8.0 \ SRC \ 3rdparty \ WebKit \ source \ WebCore \ platform \ defalocallocalizationstrategy. cpp.

Adjust Return web_ui_string ("look up" <selection> "," Look up context menu item with selected word "). Replace (" <selection> ", truncatedstringforlookupmenuitem (selectedstring ));

Return web_ui_string ("Look up \" <selection> \ "", "Look up context menu item with selected word "). replace ("<selection>", truncatedstringforlookupmenuitem (selectedstring ));

[Note] If this parameter is not modified, an error will occur in the following namke.

Platform \ defaultlocalizationstrategy. cpp (327): Error C2001: the constant contains a line break.
Platform \ defaultlocalizationstrategy. cpp (327): Fatal error c1057: unexpected end of file during macro expansion

5. Start-> Program-> Microsoft Visual Studio 2008-> Visual Studio Tools-> Visual Studio 2008 Command Prompt

6. Type:
D:
Cd d: \ QT \ 4.8.0
Configure-platform win32-msvc2008-debug-and-release [this can be configured as needed]
Nmake [the compilation duration depends on the machine situation]

7. Open vs2008, tools-> options-> projects and solutions-> VC ++ directory
Add D: \ QT \ 4.8.0 \ include to "include files"
Add D: \ QT \ 4.8.0 \ Lib to "Library File ".
Add D: \ QT \ 4.8.0 \ bin to the executable file

You can also set an environment variable qtvs2008dir in the system. The value is D: \ qtvs2008 \ 4.8.0, and then set it through the variable.


Note:

1. During the compilation process, the first step is to select the QT version, lgpl or commercial version. Here I use the lgpl version, so select O and press Enter.
Next, you will be prompted whether to accept the lgpl protocol, and enter y to confirm. This process will take about 10 ~ 20 minutes.
If the execution time is short and "Perl not found in environment-cannot run syncqt." appears at the end, configure fails.
Solution: Delete the syncqt and syncqt. BAT files under the bin directory of the QT installation.

2. Configure options

-Platform win32-msvc2005 (vs2005), 6.0 using win32-msvc, 2003 using win32-msvc.net, 2008 is win32-msvc2008

-The debug-and-release parameter indicates that QT is compiled into both the debug and release libraries. If no parameter is specified, it is compiled into a dynamic link library of the debug version.

3. How to Handle namke errors

Http://10305101ivy.blog.163.com/blog/static/584765892012227322607


Build the QT development environment under vs2008

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.