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

发布于 2024-10-18 23:09:45 字数 1024 浏览 5 评论 0原文

我对让 Qt 与 Visual Studio Express 一起工作感到困惑。大多数在线搜索都找到了使用以下指令编译 Qt 的说明:

  • 安装 MSVC2005 或 MSVC2008
  • 安装最新的 Platform SDK(@ MSDN:“Platform SDK for Windows 服务器 2003 R2")
  • 在 Platform SDK 中,您至少需要安装基础 + 互联网选项
  • 然后,下载并提取最近的快照或预览版本 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 的下载,标记为: “适用于 Windows 的 Qt 库 4.7.1(VS 2008,228 MB)”

我很困惑,我实际上还需要构建它吗?还是已经建成了?

I'm confused about getting Qt working with Visual Studio Express. Most of the searches online have turned up instructions for compiling Qt using instructions such as:

  • Install MSVC2005 or MSVC2008
  • Install the most recent Platform SDK (@ MSDN: "Platform SDK for Windows
    Server 2003 R2")
  • From the Platform SDK, you'll need to install at least the base +
    internet options
  • Then, download and extract a recent snapshot or the preview release to
    D:\Qt\4.x.x
  • Open up a console with the MSVC settings loaded (see MSVC Tools-menu)
    and go to your Qt directory
  • Type "configure -platform win32-msvc2005" without the quotation
    marks
  • That will build you the project files you'll need
  • After that, it's as simple as running "nmake" and drinking a lot of
    coffee

Then, add D:\Qt\4.x.x\bin and
D:\Qt\4.x.x\lib to your path
environment variable, and you'll be
able to use this version of Qt from
everywhere on your system. The latter
could be added to the library section
in the options from MSVC as well.

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

However, when I go to the download page of Qt (http://qt.nokia.com/downloads), there is a download for Visual Studio labeled:
"Qt libraries 4.7.1 for Windows (VS 2008, 228 MB)"

I'm confused, do I actually still need to build it? Or is it already built?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

慕烟庭风 2024-10-25 23:09:45

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

我尝试了 hello world 示例
doc.qt.nokia.com/4.7/gettingstartedqt.html。
我能够构建该项目并
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.

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

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

Using the downloadable exe from qt (http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.1-vs2008.exe) does not seem to work with Visual Studio 2010. I tried building a simple hello world program from the command line which would not run. I'll repeat my comment from a previous answer.

I tried the hello world example from
doc.qt.nokia.com/4.7/gettingstartedqt.html.
I was able to build the project and an
exe is generated. However, the exe
fails to run and generates a system
error dialog box about "side-by-side
configuration is incorrect...". I ran
SxsTrace and it says:

...
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.

To me, it looks like its trying to use
VS2008 (which I don't have). It makes
sense I guess since the download is
for VS2008.

I was in the process of compiling qt 4.7.1 using the instructions in my question (using win32-msvc2010 as my platform target however) as I asked this SO question and the compilation finished. I rebuilt the hello world project and the exe runs. So it seems like the answer is in order to use with Visual Studio Express 2010 you currently do need to compile (at least until Qt releases a VS2010 download option). However, I believe if you are using VS2008 then you will not need to compile.

じ违心 2024-10-25 23:09:45

诺基亚为 Windows 提供的 Qt 二进制文件以 MinGW 或 Visual Studio 2008 为目标,两者都用于编译 32 位可执行文件。如果您需要 VS 2005(32 位)的 Qt 二进制文件,您可以在他们的档案中找到它们。

对于其他一切,您需要自己编译 Qt。特别适用于:

  • Visual Studio 2008 64 位
  • Visual Studio 2008 Express Edition 64 位:您需要 Windows SDK 7.0,它提供 64 位编译器并使用这些编译器编译 Qt。
  • Visual Studio 2010 32 位和 64 位

一般来说,您不能链接使用不同编译器编译的库,即使用使用 VC 9.0 (VS 2008) 32 位构建的 Qt 二进制文件并将它们链接到使用 VC 10.0 (VS 2010) 32 构建的可执行文件少量。

The Qt binaries provided by Nokia for Windows target either MinGW or Visual Studio 2008, both for compiling 32bit executables. If you need Qt binaries for VS 2005 (32bit), you may find them in their archives.

For everything else, you need to compile Qt yourself. Especially for:

  • Visual Studio 2008 64 bit
  • Visual Studio 2008 Express Edition 64 bit: You need the Windows SDK 7.0 which provides the 64 bit compilers and compile Qt with those.
  • Visual Studio 2010 32 bit and 64 bit

In general, you cannot link libraries compiled with different compilers, i.e. use the Qt binaries built with VC 9.0 (VS 2008) 32 bit and link them to an executable built with VC 10.0 (VS 2010) 32 bit.

浅沫记忆 2024-10-25 23:09:45

只是对此的一个小更新。
下载QTSDK(并使用cmake而不是qmake,一切看起来都工作得很好。除了QTSDK的安装程序没有更新qmake.exe的路径,你必须手动完成。

使用QtSDK 4.8和测试视觉工作室快车 2010

Just a small update on this.
Downloading the QTSDK (and using cmake instead of qmake everything looks like working quite well. Except for the fact that the installer of QTSDK didn't update the path for qmake.exe and you've to do by hand.

Tested with QtSDK 4.8 and visual studio express 2010

缺⑴份安定 2024-10-25 23:09:45

http://qt.nokia.com/downloads 有一个名为 qt-vs-addin 的链接-1.1.7.exe (57 MB)

您可能也需要这个。 。

我认为您不需要编译这些库,因为现在可以下载它们。 。

因此,获得 228 MB 的库和 57 MB 的插件,您就应该准备好了。

免责声明:我还没有使用 MSVC,所以请告诉我它是否有效。

http://qt.nokia.com/downloads has a link called qt-vs-addin-1.1.7.exe (57 MB)

You'll probably need that one as well . .

I don't think you need to compile the libraries since there is a download for them now . .

So get the 228 MB of libs and 57 MB plugin and you should be set.

DISCLAIMER: I don't use MSVC (yet?) so please let me know if it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文