Compiling Qt - Visual Studio 2010

ぐ巨炮叔叔 提交于 2019-12-03 13:36:14

问题


I am looking for any tutorials or information on compiling Qt 4.7 with Visual Studio 2010.

I've recently have run into an bug using Qt 4.7.1 libraries on Visual Studio 2010 and have found information that recompiling Qt with 2010 can potentially solve it. Edit: This has solved the issue.

Ref: http://www.qtforum.org/article/34406/heap-corruption-caused-by-calling-selectedindexes-method-of-qitemselectionmodel-class.html

After Researching for awhile, I was successfully able to compile Qt in VS2010 using the following:

Compile:

  1. set QMAKESPEC=win32-msvc2010
  2. configure -platform win32-msvc2010
  3. nmake

Integration to VS2010:

  1. Download Visual Studio Qt add-in and install
  2. Select from menu: Qt/Configure Qt Versions.
  3. Add new version to point to compiled binaries
  4. Restart Visual studio and rebuild projects.

Hope this helps others...

Further Refs:

http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/ http://blog.paulnettleship.com/2010/11/11/troubleshooting-visual-studio-2010-and-qt-4-7-integration/ http://dcsoft.wordpress.com/2010/01/30/how-to-setup-qt-4-5-visual-studio-integration/

Note: recompiling for VS2010 fixed bug experienced above.


回答1:


You mean something like this?

Here is the official documentation.




回答2:


I've used jom instead of nmake for faster compilation. Here is my step-by-step compilation guide: http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/




回答3:


Qt V4.8.0 contains prebuilt binaries for Visual Studio 2010 so you don't need to build manually anymore: http://qt.nokia.com/downloads/windows-cpp-vs2010




回答4:


You shouldn't need the QMAKESPEC if you are passing -platform win32-msvc2010 to configure

define the QTDIR environment variable to poitn to the 4.7.1 top level dir. Less stuff requires it now with the improved vs integration but it makes setting paths easier, especially if you use multiple versions.



来源:https://stackoverflow.com/questions/4379374/compiling-qt-visual-studio-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!