使用 Visual C++ 2010 构建 Qt 4.5

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1644172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 20:44:22  来源:igfitidea点击:

Building Qt 4.5 with Visual C++ 2010

c++visual-studio-2010qt4

提问by C?t?lin Piti?

Did somebody tried to build Qt 4.5 with Visual Studio 2010 (Beta 2)? Any hints on doing that successfuly?

是否有人尝试使用 Visual Studio 2010(Beta 2)构建 Qt 4.5?任何关于成功的提示?

Later editI tried to run configure from a Visual Studio 2010 console. There is no makespecs support for 2010, so configure fails because of that.

后来编辑我尝试从 Visual Studio 2010 控制台运行配置。2010 没有 makespecs 支持,因此配置失败。

回答by Ben

It worked for me to build just as if it was vs2008, but using the vs2010 tools:

它对我来说就像是 vs2008 一样构建,但是使用 vs2010 工具:

  1. Open vs2010 command prompt. cd into the top-level Qt directory.
  2. configure.exe -platform win32-msvc2008 -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-multimedia -no-qt3support -fast
  3. nmake
  1. 打开 vs2010 命令提示符。cd 进入顶级 Qt 目录。
  2. configure.exe -platform win32-msvc2008 -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-multimedia -no-qt3support -fast
  3. 制作

回答by guesser

For Qt 4.6.2 (or perhaps other 4.6 versions as well)...

对于 Qt 4.6.2(或者也可能是其他 4.6 版本)...

To save you some time, here are the errors which need fixing in order to build webkit (this is to expand upon Ben's answer).

为了节省您的时间,以下是构建 webkit 需要修复的错误(这是对 Ben 的回答的扩展)。

The errors appear in the following files (the two files are identical, and the errors need to be fixed in each):

错误出现在以下文件中(这两个文件是相同的,每个文件中的错误都需要修复):

  • %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h
  • %QTDIR%\qt\src\3rdparty\javascriptcore\JavaScriptCore\runtime\StructureTransitionTable.h
  • %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h
  • %QTDIR%\qt\src\3rdparty\javascriptcore\JavaScriptCore\runtime\StructureTransitionTable.h

Here are the errors and how to fix them:

以下是错误以及如何修复它们:

  1. %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h(146) : table()->add(key, Transition(structure, 0));
    Change it to table()->add(key, Transition(structure, nullptr));
  2. %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h(153) : table()->add(key, Transition(0, structure));
    Change it to table()->add(key, Transition(nullptr, structure));
  3. Make the same two changes for %QTDIR%\qt\src\3rdparty\javascriptcore\JavaScriptCore\runtime\StructureTransitionTable.h (or copy your edited file over this one)
  1. %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h(146) :将其 table()->add(key, Transition(structure, 0));
    更改为table()->add(key, Transition(structure, nullptr));
  2. %QTDIR%\qt\src\3rdparty\webkit\javascriptcore\runtime\StructureTransitionTable.h(153) :将其 table()->add(key, Transition(0, structure));
    更改为table()->add(key, Transition(nullptr, structure));
  3. 对 %QTDIR%\qt\src\3rdparty\javascriptcore\JavaScriptCore\runtime\StructureTransitionTable.h 进行相同的两项更改(或将您编辑的文件复制到这一项上)

回答by manloeste

The qt-vs-addin-1.1.6recognizes VS 2010 now as a suitable platform, but it's not documented yet by qt.

现在qt-vs-addin-1.1.6将 VS 2010 视为合适的平台,但 qt 尚未对其进行记录。

回答by sivabudh

With Qt 4.7 and Visual Studio Add-in 1.1.7, it integrates with VS2010.

使用 Qt 4.7 和Visual Studio Add-in 1.1.7,它与 VS2010 集成。

See this.

看到这个

回答by Dan

Also note that -platform win32-msvc2010 now works as well instead of having to use win32-msvc2008.

另请注意,-platform win32-msvc2010 现在也可以正常工作,而不必使用 win32-msvc2008。

回答by Tutorial

You can find a tutorial how to compile Qt 4.7 Beta 1 using Visual Studio 2010 and Windows 7 here:

您可以在此处找到如何使用 Visual Studio 2010 和 Windows 7 编译 Qt 4.7 Beta 1 的教程:

TUTORIAL

教程

回答by C?t?lin Piti?

For the moment... I will continue using the builds made with VS 2008 with VS 2010. While I am using it for development purpose only, with no intentions for releasing something (so no manifest nightmare yet), it is acceptable. Hopefully, Qt will soon officially support VS2010.

目前……我将继续使用 VS 2008 和 VS 2010 构建的版本。虽然我仅将其用于开发目的,无意发布某些内容(因此还没有明显的噩梦),但这是可以接受的。希望 Qt 很快就会正式支持 VS2010。