how to build a hello word like application using Qt and VS2010
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:
- installed VS2010
- installed VS2010 SP1
- downloaded and installed qt-win-opensource-4.7.2-vs2008.exe
- 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:
Ca开发者_Python百科n 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?
Sounds like you have downloaded the source. You can either build the SDK using the downloaded source or you can download an installable SDK: http://get.qt.nokia.com/qt/source/qt-win-opensource-4.7.2-vs2008.exe. This installs just the framework. You have to download the development tools (QtCreator, QtDesigner, QtAssistant, etc) separately.
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
精彩评论