如何构建一个hello词像应用程序使用Qt和VS2010 [英] how to build a hello word like application using Qt and VS2010

查看:130
本文介绍了如何构建一个hello词像应用程序使用Qt和VS2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在这里和网上的其他地方读了很多答案,但我仍然无法建立/运行一个小的hello世界像应用程序使用VS2010和最新的Qt开源(4.7.2)VS2008。 / p>

这里是我完成的步骤,当然在需要时重新启动:


  1. 安装了VS2010

  2. 安装了VS2010 SP1

  3. 下载并安装了qt-win-opensource-4.7.2-vs2008.exe

  4. 下载并安装了qt-vs-addin-1.1.9.exe

在VS2010中, Qt的模板。我选择了QT应用程序,接受默认值并创建一个。首先它没有找到QTDIR文件夹。所以我以管理员身份运行c:\Qt\4.7.2\bin\qtvars.bat,现在VS2010在构建项目/查找包含文件时没有问题。



这是我的知识停止,我仍然不能运行从生成的exe文件。当从Total Commander启动创建的exe文件时,它说:





,当在VS2010中启动时,它说:



你能帮我解决这个问题,什么是可能的解决方案? 所有这一切发生,因为Qt是为VS2008编译,我试图使用VS2010?但我已经读过它在许多地方,它应该工作很好。



如果我需要重新编译Qt for VS2010,那么最好的方法是什么?我想创建简约的OpenGL应用程序使用Qt,在这种情况下什么是适当的方式配置Qt?



Shell我完全卸载Qt并从源代码开始?

解决方案

经过大量的阅读和尝试和错误,我做了它的工作,我在这里写了一个指南:



如何为Visual Studio 2010建立Qt


I have read many answers both here and on other places on the net, but I'm still unable to build / run a small hello world like application using VS2010 and the latest Qt opensource (4.7.2) for VS2008.

Here are the steps I've done, and of course restarted where needed:

  1. installed VS2010
  2. installed VS2010 SP1
  3. downloaded and installed qt-win-opensource-4.7.2-vs2008.exe
  4. downloaded and installed qt-vs-addin-1.1.9.exe

In VS2010 now I have the project templates for Qt. I selected QT Application, accepted defaults and created one. First it didn't find the QTDIR folder. So I've run c:\Qt\4.7.2\bin\qtvars.bat as administrator, and now VS2010 have no problem with building the project / finding the include files.

And thats where my knowledge stopped, I still cannot run the exe files created from the build. When starting the created exe files from Total Commander, it says:

and when starting them from within VS2010 it says:

Can you help me what is causing this problem and what is a possible solution for this? Is all this happening because Qt is compiled for VS2008 and I'm trying to use VS2010? But I've read it on many places that it should work well.

And if I need to recompile Qt for VS2010, then what is the best way to do it? I would like to create minimalistic OpenGL applications using Qt, what is the appropriate way to configure Qt in this case?

Shell I uninstall Qt totally and start from sources?

解决方案

After a lot of reading and trial and error, I made it work and I wrote a guide about it here:

how-to build Qt for Visual Studio 2010

这篇关于如何构建一个hello词像应用程序使用Qt和VS2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆