详解Qt中VS 2010插件安装教程

移动开发
Qt中VS 2010插件安装是本文要介绍的内容,主要是来了解QT中插件的问题,文章通过VS 2010环境来学习插件的安装,具体内容来看详解。

QtVS 2010插件安装是本文要介绍的内容,主要是来了解QT插件的问题,Qt默认使用mingw编译,不支持VS编译器,因此,如果需要用VS开发,需要将Qt重新编译。前提:Qt已安装(http://qt.nokia.com/downloads-cn),VS已安装。

1、下载Visual Studio Add-in

  1. http://qt.nokia.com/downloads-cn 

2、安装Visual Studio Add-in

3、重新编译Qt

(1)用Visual Studio Command Prompt进行编译。

开始菜单 --> Microsoft Visual Studio 2008 --> Visual Studio Tools --> Visual Studio Command Prompt。

注意:是使用Visual Studio Command Prompt,而不是直接的cmd Dos窗口。

(2)进入Qt的安装目录后,执行CD Qt,进入Qt的根目录。

  1. cd C:\Qt\2010.05\qt 

(3)运行命令 configure -platform

win32-msvc2008。o(选择opensource模式)回车,Y(同意license)回车编译时间我用了半个小时。
   
(4)运行命令nmake,需要大概3个小时。

编译期间会产生编译错误,我编译的是Windows 7下的VS2008版本。解决方法如下:

错误:

  1. api\qscriptextensionplugin.h(43): Error: Undefined   
  2. interface  
  3. NMAKE : fatal error U1077: 'C:\Qt\2010.05\qt\bin\moc.exe' : return   
  4. code '0x1'  
  5. Stop.  
  6. NMAKE : fatal error U1077: '"c:\Program Files\Microsoft   
  7. Visual Studio 9.0\VC\BIN  
  8. \nmake.exe"' : return code '0x2'  
  9. Stop.  
  10. NMAKE :   
  11. fatal error U1077: 'cd' : return code   
  12. '0x2'  
  13. Stop. 

解决:

删除

  1. C:/Qt/2010.05/qt/src/script/tmp/moc/debug_shared/mocinclude.tmp  
  2. C:/Qt/2010.05/qt/src/script/tmp/moc/release_shared/mocinclude.tmp 

其他错误解决:

删除

 

  1. C:/Qt/2010.05/qt/src\3rdparty\webkit\WebCore\tmp\moc\debug_shared\mocinclude.tmp   
  2. C:/Qt/2010.05/qt/src\3rdparty\webkit\WebCore\tmp\moc\release_shared\mocinclude.tmp  
  1. 参考:http://tech.it168.com/a2010/1217/1139/000001139431_1.shtml  
  2. http://developer.qt.nokia.com/wiki/QtVSAddin    
  3. (通过源码进行编译配置)  
  4. http://blog.csdn.net/hongqiang200/archive/2010/09/09/5873585.aspx      
  5. (编译错误解决) 

4、配置VS。

打开VS2008。Qt --> Options,增加Path:C:\Qt\2010.05\qt。

打开pro文件或者新建Qt项目即可。
  
如果之前是mingw版本,那么在增加path时可能出现:qt in the given path was built using mingw。
  
解决方法:删除C:\Qt\2010.05\qt\lib下的libqtmain.a和libqtmaind.a,因为是通过找这2个文件判断是否是mingw编译版本。(可剪切到其他地方,以防再需要回到mingw版本)。

小结:详解QtVS 2010插件安装教程的内容介绍完了,希望通过本文的学习能对你有所帮助!

责任编辑:zhaolei 来源: 互联网
相关推荐

2011-06-23 10:16:55

VS2010 QT 4.7.2 QT

2011-09-01 16:01:25

Qt插件

2011-06-24 15:16:33

Qt 插件

2011-06-24 09:13:30

QT SDL

2011-06-24 17:05:07

QT QT 4.7.3 windows

2011-06-23 09:54:00

VS2010 Qt 4.7.2 Qt

2010-12-16 10:00:20

QtVisual Stud

2011-06-27 16:59:19

Qt 动态 插件

2011-06-24 10:54:34

Qt Mysql

2010-05-06 17:46:47

2011-06-27 17:24:37

Qt 插件

2011-09-07 16:28:46

QT WidgetQWidget

2011-09-01 14:04:45

QT Webkit插件

2009-07-10 16:10:38

MyEclipse 7

2011-06-24 08:46:37

Linux Qt x11 4.5

2011-06-24 09:39:05

2011-09-06 15:38:20

QT安装

2011-06-14 11:48:38

Webkit QT

2011-07-04 15:48:57

Qt 桌面

2012-09-11 15:20:08

MooseFS
点赞
收藏

51CTO技术栈公众号