Visual C++ 2010 Express:如何使用Qt?

Use*_*ser 13 c++ qt qt4 visual-studio-express visual-c++-2010

我对让Qt使用Visual Studio Express感到困惑.大多数在线搜索都出现了使用以下指令编译Qt的说明:

  • 安装MSVC2005或MSVC2008
  • 安装最新的Platform SDK(@ MSDN:"适用于Windows Server 2003 R2的Platform SDK")
  • 从Platform SDK,您至少需要安装base + internet选项
  • 然后,下载并将最近的快照或预览版本解压缩到D:\ Qt\4.xx
  • 打开加载了MSVC设置的控制台(请参阅MSVC工具菜单)并转到Qt目录
  • 键入"configure -platform win32-msvc2005",不带引号
  • 这将构建您需要的项目文件
  • 在那之后,它就像运行"nmake"和喝大量咖啡一样简单

然后,将D:\ Qt\4.xx\bin和D:\ Qt\4.xx\lib添加到路径环境变量中,您将能够在系统的任何位置使用此版本的Qt.后者可以添加到MSVC选项中的库部分.

(来自http://www.qtcentre.org/threads/11710-Visual-Studio-2005-Express)

但是,当我访问Qt(http://qt.nokia.com/downloads)的下载页面时,Visual Studio的下载标记为:"Qt libraries 4.7.1 for Windows(VS 2008,228 MB)"

我很困惑,我真的还需要建立吗?或者它已经建成了吗?

Use*_*ser 4

使用 qt (http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.1-vs2008.exe) 中的可下载 exe 似乎不适用于 Visual Studio 2010。我尝试构建命令行中的一个简单的 hello world 程序无法运行。我将重复之前答案中的评论。

我尝试了 doc.qt.nokia.com/4.7/gettingstartedqt.html 中的 hello world 示例。我能够构建该项目并生成一个 exe。但是,该exe无法运行并生成一个有关“并行配置不正确...”的系统错误对话框。我运行了 SxsTrace,它显示:

...
INFO: Begin assembly probing.
INFO: Did not find the assembly in WinSxS.
INFO: Attempt to probe manifest at C:\Windows\assembly\GAC_32\Microsoft.VC90.DebugCRT\ 9.0.21022.8__...\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.DLL.
INFO: Attempt to probe manifest at C:\qthello\debug\Microsoft.VC90.DebugCRT\Microsoft.VC90.DebugCRT.MANIFEST.
INFO: Did not find manifest for culture Neutral.
INFO: End assembly probing.
ERROR: Cannot resolve reference Microsoft.VC90.DebugCRT,processorArchitecture="x86", publicKeyToken="...",type="win32",version="9.0.21022.8".
ERROR: Activation Context generation failed.
End Activation Context Generation.
Run Code Online (Sandbox Code Playgroud)

对我来说,它看起来像是在尝试使用 VS2008(我没有)。我想这是有道理的,因为下载的是 VS2008。

当我问这个SO问题并且编译完成时,我正在使用我的问题中的说明(但是使用win32-msvc2010作为我的平台目标)编译qt 4.7.1。我重建了 hello world 项目并且 exe 运行。所以看来答案是为了与 Visual Studio Express 2010 一起使用,您当前确实需要编译(至少在 Qt 发布 VS2010 下载选项之前)。不过,我相信如果你使用的是VS2008那么你就不需要编译了。